ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Google Maps with Location Distance Integration Tutorial

customization
script

#1

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


Google Travel Distance Table Integration Tutorial (Distance Matrix API)
Gps coordinates
Google Travel Distance Table Integration Tutorial (Distance Matrix API)
Where to put frappe hooks
Cannot proceed with update: You have local changes in app "frappe" that are not committed
#2

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


#3

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:


#4

Hi @Seng,

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


#5

Thanks! Hope you like it!


#6

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


#7

@Seng . Great work !!!


#8

@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.


#9

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.


#10

@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.


#11

@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.


#12

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


#13

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


#14

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


#15

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


#16

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.


#17

@Oasis_Agano Yes it is, I tested on 7.1


#18

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.


#19

Hi!

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

Thanks!


#20

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.

https://www.google.ae/maps/dir//dd1/dd2/dd3/dd4… 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