Pan slowly on click on the nuisance map
This commit is contained in:
parent
82adb92d06
commit
8bed4fa2fa
2 changed files with 9 additions and 6 deletions
|
|
@ -12,6 +12,7 @@
|
|||
const MAPBOX_ACCESS_TOKEN = "{{.MapboxToken}}";
|
||||
async function handleMapClick(mapLocator, lngLat) {
|
||||
mapLocator.SetMarker(lngLat);
|
||||
mapLocator.PanTo(lngLat, {duration: 2000});
|
||||
const response = await geocodeReverse(MAPBOX_ACCESS_TOKEN, {
|
||||
lat: lngLat.lat,
|
||||
lng: lngLat.lng,
|
||||
|
|
@ -115,10 +116,12 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
},
|
||||
zoom: 14,
|
||||
});
|
||||
mapLocator.SetMarker([
|
||||
const coords = [
|
||||
position.coords.longitude,
|
||||
position.coords.latitude,
|
||||
]);
|
||||
];
|
||||
mapLocator.SetMarker(coords);
|
||||
mapLocator.JumpTo({center: coords, zoom: 14});
|
||||
handleMarkerDrag({
|
||||
lat: position.coords.latitude,
|
||||
lng: position.coords.longitude,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue