Can't find any documentation or usage on geolocation

I am trying to build a custom app with Geolocation, I have trouble using the control. I find no documentation about the Geolocation control and what I do find is not helpful.

First my problem, I want to show a location on the Map in my DocType, I have lat, long
Below is the code I have

const location = `{"type": "FeatureCollection",  "features": [{"type": "Feature","properties": {},"geometry": {"type": "Point","coordinates": ${frm.doc.latlong} }}]}`;	
					
		frm.set_value("location", location);
		var ctrl = frm.get_field("location").locate_control;
               
		if(ctrl) //locate control is null in reload,
				ctrl.start(); //This move to my current location and not to the location I set 

What I want to do

  1. Show a pin the map where I set the latlong value, it shows Mumbai when it loads even after I set the value (See above)
  2. Zoom it into the street level.
  3. Center the point on form reload.
  4. Freeze it and not allow anyone to add additional pins.

Additional questions.
Can I replace open maps implementation with google maps? Is there any example of the implementation?

May be this will help you.

1 Like

Thanks a lot, I was able to search based on that and found documentation.