forked from orson/bachemap
ooops, my bad x4
This commit is contained in:
parent
fd45588e19
commit
8fbd2eba5a
@ -110,7 +110,7 @@
|
|||||||
latlng.lat = parseFloat(latlng.lat).toFixed(6);
|
latlng.lat = parseFloat(latlng.lat).toFixed(6);
|
||||||
latlng.lng = parseFloat(latlng.lng).toFixed(6);
|
latlng.lng = parseFloat(latlng.lng).toFixed(6);
|
||||||
console.warn("Latitud:", latlng.lat, "Longitud:", latlng.lng);
|
console.warn("Latitud:", latlng.lat, "Longitud:", latlng.lng);
|
||||||
|
destination = L.latLng(latlng.lat, latlng.lng);
|
||||||
// Calculate the vertical offset (25% of the map's height)
|
// Calculate the vertical offset (25% of the map's height)
|
||||||
let offset = map.getSize().y * 0.25;
|
let offset = map.getSize().y * 0.25;
|
||||||
// Convert the clicked location to container point
|
// Convert the clicked location to container point
|
||||||
@ -121,7 +121,7 @@
|
|||||||
let targetLatLng = map.containerPointToLatLng(targetCenterPoint);
|
let targetLatLng = map.containerPointToLatLng(targetCenterPoint);
|
||||||
|
|
||||||
// Fly to the adjusted center so the marker appears 25% lower from the center
|
// Fly to the adjusted center so the marker appears 25% lower from the center
|
||||||
map.flyTo(latlng, 17, { duration: 0.7 });
|
map.flyTo(targetLatLng, 17, { duration: 0.7 });
|
||||||
map.once('moveend', function() {
|
map.once('moveend', function() {
|
||||||
user_marker.setLatLng(latlng).bindPopup('<button id="pinner-pop">Agregar bache-o-cosa</button>').openPopup();
|
user_marker.setLatLng(latlng).bindPopup('<button id="pinner-pop">Agregar bache-o-cosa</button>').openPopup();
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user