From 22dceaac54204d0d72ce7e8bf88552177f3ebadf Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sat, 23 Mar 2024 22:43:55 +1300 Subject: [PATCH] add config for zoom level when navigating to node --- src/public/index.html | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/public/index.html b/src/public/index.html index 18b1144..32cb430 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -832,13 +832,20 @@
- +
Neighbours further than this are hidden. Reload to update map.
+ +
+ + +
How far to zoom map when navigating to a node.
+
+
@@ -861,6 +868,16 @@ return localStorage.setItem("config_neighbours_max_distance_in_meters", value); } + function getConfigZoomLevelGoToNode() { + const value = localStorage.getItem("config_zoom_level_go_to_node"); + const parsedValue = value != null ? parseInt(value) : null; + return parsedValue || 10; + } + + function setConfigZoomLevelGoToNode(value) { + return localStorage.setItem("config_zoom_level_go_to_node", value); + } + @@ -1454,7 +1475,7 @@ showNodeOutline(id); // fly to node marker - map.flyTo(nodeMarker.getLatLng(), 10, { + map.flyTo(nodeMarker.getLatLng(), getConfigZoomLevelGoToNode(), { animate: true, });