fix: auto-zoom to street level when first GPS point arrives
All checks were successful
CI / update (push) Successful in 2m19s
All checks were successful
CI / update (push) Successful in 2m19s
When the map starts zoomed out (level 5), snap to zoom 16 on the first real GPS position instead of keeping the overview level.
This commit is contained in:
@@ -229,8 +229,8 @@
|
|||||||
const ll = [pt.lat, pt.lng];
|
const ll = [pt.lat, pt.lng];
|
||||||
liveMarker.setLatLng(ll);
|
liveMarker.setLatLng(ll);
|
||||||
liveMarker.setStyle({ opacity: 1, fillOpacity: 1 });
|
liveMarker.setStyle({ opacity: 1, fillOpacity: 1 });
|
||||||
const zoom = liveMap.getZoom() || 16;
|
const zoom = liveMap.getZoom();
|
||||||
liveMap.setView(ll, zoom);
|
liveMap.setView(ll, zoom < 14 ? 16 : zoom);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user