Geolocation field

Geolocation is fine.
Maybe the easiest to translate for everyone would be “Location” as this is the default term used in English Language Android/iOS etc.
Either that or “Locale” or “Map”. Just as all of these words are shorter than geolocation. The icon should be standard location “pin” icon.

I planned a similar feature and planned to use “geocode”. It’s shorter than “geolocation” and more meaningful than"geozone" but not worth getting upset over. “GeoJSON” is what is literally is, so that’d be fine too.

“Geolocation” itself will be more meaningful.

Hi @revant_one ,
I have successfully added a geolocation field (thanks to your contribution to this post!) to show all features (markers) from a featurecollection on a map , but i want to show the marker name (passed in properties as name on the featurecollection) when I click on the marker.

I have no idea on how to do that.

I tried:

  • Creating an attribute on the map’s HTML for each marker (and the calling it with jquery to show a tooltip.
  • Using the bindPopup method on a marker (but couldn’t find a way to call it).

I have not been able to make it work…Do you have any pointers?

I’d really appreciate your time and effort.

The field is part of framework

It is here : frappe/geolocation.js at develop · frappe/frappe · GitHub

Also check leaflet API documentation for what you need.
https://leafletjs.com/plugins.html

Thanks a lot!

is the geolocation data accessible via API? and if so how can i extract it?

Here are relevant docs

geolocation https://erpnext.org/docs/user/manual/en/customize-erpnext/articles/field-types.html

https://frappe.io/docs/user/en/guides/integration/rest_api

A forum search should yield lots of ideas and pointers

Yes that i am aware but when you enable the location field in customer and do the get request of the same customer after creating the customer. Location is not part of the json response.

I have also tried using FrappeClient in bench console and still no location data being returned back in the response

How can i get the location of the customer?

Thanks i have seen what you meant. it works now

Excellent good to hear - of course whatever ‘ah-ha’ learning tip notes that you can add for your own recall reference will help others follow in your steps too!

I have been going through the thread above but it doesn’t really my question so I was wondering if there way of adding description/details for points, polygons in the geolocation field on. For, example if I have more than one point and I want to give the first point a description as “point1” and the second as “point2” when the user hovers over the point as shown in the screenshot below.

You cannot name the points via UI.

The data is just geojson feature collection, you can save additional data manually (some customisation), if storing data is important. It won’t reflect on UI.

If you wish to add the feature, add appropriate leaflet plugin. Note that there is limited space on geolocation field, only important plugins are kept on UI.

@revant_one thanks alot for the prompt reply, I will have to think of another way to solve the issue. You also said the geojson field has limited space is there any other way of storing an unlimited number of points on a map for example if i want to see all the assets of a company in on one map in erpnext or can the max length of geojson field be customized.

For storing data there is no restriction, it is just another field in database.

The UI has lot of functionality already, it can draw polygons, circles, place points. It becomes cluttered when field is placed in 2 column layout.

For any developer who wish to add this to features, there is a plugin available.

@revant_one thanks so much for the help I will look into it

Hi @revant_one

Trust you’re doing great and thanks again for all the great work in the community. This no longer works as stated above in V12. Could you pls suggest if there’s a way to restore this behaviour for V12 instances?

Kind regards,

I am not able to fix the issue with the plugin

same thing happening here https://www.openstreetmap.org/ for me (from pc chromium)

It is working on my android chrome 80.0.3987.99
it is working on my laptop chrome 80.0.3987.106

Hi @revant_one

But it works fine in V11! Tested it again… it defaults to current location but in V12 you have to click on the location button. This is strange

Is there any way to automatically trigger the location button with a custom script (preferably client-side)?

Kind regards,