Google Maps with Location Distance Integration Tutorial

Show Google Maps with Distance between locations using Google API.

Feedback or improvements are welcome.

Download The Guideline And Script Here:
ERPNext Google Maps With Distance Integration Documentation v1.0.rar

Other Related Tutorial:
Google Travel Distance Table Integration Tutorial

Screenshot:

Best Regards
Seng

20 Likes

Wow, interesting feature. I will take a look on this.
Thank you for sharing.

Thanks, appreciate if anyone could guide me how can I onload the javascript as the page loads in ERPNext so I could make the address or location autocomplete works.

UPDATE: I couldn’t found a way to make the javascript to be running when the page onload. So the autocomplete aren’t able to implement. If there is anyone know to do this please do DM me and I will try to make the autocomplete work. :slight_smile:

1 Like

Hi @Seng,

great feature… would love to have that for customers
eg delivery addresses

1 Like

Thanks! Hope you like it!

1 Like

This would be a great feature to add. Incorrect addresses are the bane of every accountant and driver.

@Seng . Great work !!!

@Seng You could to it by changing this
frappe.ui.form.on("Employee", "load_this", function(frm){
To this
frappe.ui.form.on("Employee", "refresh", function(frm){
It will run on every refresh, because if you do onload and there is no address in mentioned in the field, it will not listen anymore after the page loads. While on refresh it will listen continuously.

Thanks for the great addon.

You could to it by changing this
frappe.ui.form.on(“Employee”, “load_this”, function(frm){
To this
frappe.ui.form.on(“Employee”, “refresh”, function(frm){

@mrmo Thanks for the suggestion, but however, I tried to replace the button click trigger to refresh or onload, the whole script will freeze and not functioning in ERPNext.

@Seng Can you share the script or you right click on the page and click “inspect element” and go to “console” to share the error on the page, will be helpfull.

@mrmo I am using the exact same script in the documentation above by changing
frappe.ui.form.on(“Employee”, “load_this”, function(frm){
to
frappe.ui.form.on(“Employee”, “refresh”, function(frm){
OR
frappe.ui.form.on(“Employee”, “onload”, function(frm){

It gives me the error as refer to the image below. This error does not happen when I am using it as a button to call the function.

Thanks.

Greetings
is this code still operational in the current version(7/7.2) so that i can use it?
What i want is to assign locations to customers then add some extra costs to someone in more than 10km…
kr

1 Like

That would be very helpful for distributors. If it’s not being actively developed we could put together a bounty.

1 Like

Then maybe add a map showing the different locations of your clients…

3 Likes

Would there be a way to do address hygiene with this script to test inputted addresses to known address database and correct?

The Google Maps API does not do CASS Certified address correction, but something like the places autocomplete could do the job for most of us. If you want to go against a certified USPS database I’d recommend using something like Semaphore’s ZP4 software by exporting the data from ERPNext. Not the most efficient way but we just take a few minutes and put all of our new customer’s addresses through at the end of the month.

@Oasis_Agano Yes it is, I tested on 7.1

1 Like

Thanks @cattmy. I am familiar with this and some other CASS address hygiene products. You are right that the autocomplete would probably work for most.

Hi!

I do not understand if the map options are actually implemented in ERPNEXT (actual versiĂłn is 7.2.7)

Thanks!

Hi may be out of subject.
We wanted our driver to get a direction link for all deliveries’ location in google maps.
For that we will keep a record of google maps decimal degrees(dd) and/or makani number(local UAE location identification).

I found a way if our ERPNext developer will able to generate a link as per below. He agreed and currently under process.

Google Maps… Etc

For example
https://www.google.ae/maps/dir//25.32382,55.455001/25.322419,55.376854/25.360481,55.416183/25.20253,55.376968

This will be driving directions, and can arrange stop points up/down as per requirment.

Don’t know any coding knowledge though.

Thanks ERPNext and My current developer @vivek