leaflet-locatecontrol icon indicating copy to clipboard operation
leaflet-locatecontrol copied to clipboard

Display lat, lng, alt in the inner marker popup

Open luisfio1 opened this issue 2 years ago • 0 comments

Would it be possible to change the popup string to show the lat, lng and altitude of my position?

These are variables that I have defined in my script.

lc = L.control.myLocate({ locateOptions: { enableHighAccuracy: true } }).addTo(map);

map.on('locationfound', function (evt) {

LatLng = evt.latlng;
longitud= LatLng.lng;
latitud= LatLng.lat;
altitud= evt.altitude;	
currentPos = [latitud, longitud];

luisfio1 avatar Jun 07 '23 17:06 luisfio1