Based on your suggestion I found the following leaflet plugin:
Would however need assistance in getting this implemented. How do I go about it? What I’d like to achieve is to have the address automatically populated in a field similar to how the Latitude and Longitude get automatically populated in the Location DocType
Then check how geolocation field is made. You can add many plugins.
Custom app alternatives is:
Once the field is loaded on form it is an object of the control class.
You can hack things up on properties of the field object in your custom script. Get the object with frm.get_field() you get the map, plugins and other functions here.
It works well in the desk side, but it seems that this geolocation field type cannot be seem in a web form. When I create a new field in the web form, I see the geoposition field from the doctype, but the is no “Geolocation” in the list of field type.
Is there any standard way to show this field in web form?
I’m running into a similar issue. I’m trying to read data from form field then change the market on the map. This is my code, but it doesn’t move the market.
frappe.ui.form.on("Shipment", "vessel_location", function(frm) {
var imo = cur_frm.doc.imo_number_vessel;
var latitude= 50.454100;
var longitude= -2.370833;
cur_frm.get_field("location").locate_control._marker._latlng.lat = latitude;
cur_frm.get_field("location").locate_control._marker._latlng.lng = longitude;
Any suggestions pls ? Also, if the html header approach isn’t feasible, could you pls give some guidance on how to add the plugin via custom script? If I can get a better idea how to add a plugin, I think I could figure the rest out
Could you pls give some more insight on how you achieved this? How were you able to access the map’s HTML? Did you have to use a separate field other than the geolocation field itself?