Limits the coordinate precision to 6 digits: ~ 0.1 meter max

This commit is contained in:
Léo Serre 2021-05-19 20:34:02 +02:00
parent 82f334143f
commit 428ce900f0
1 changed files with 4 additions and 4 deletions

View File

@ -48,13 +48,13 @@ $( document ).ready(function() {
mymap.on('click', function(e){
poi_layer.unbindTooltip();
poi_layer.setLatLng(e.latlng);
$("#lat").val(e.latlng.lat);
$("#lon").val(e.latlng.lng);
$("#lat").val(e.latlng.lat.toFixed(6));
$("#lon").val(e.latlng.lng.toFixed(6));
})
poi_layer.on('move', function(e){
poi_layer.unbindTooltip();
$("#lat").val(e.latlng.lat);
$("#lon").val(e.latlng.lng);
$("#lat").val(e.latlng.lat.toFixed(6));
$("#lon").val(e.latlng.lng.toFixed(6));
})
var poiicon = L.icon({