From 96ee4667e6d5b7b2ea43453d68027b9a8f0eb2c9 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Mon, 26 Aug 2024 18:26:54 +1200 Subject: [PATCH] update node outline to be based on position precision --- src/public/index.html | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/public/index.html b/src/public/index.html index f055237..724a844 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -3169,15 +3169,23 @@ clearNodeOutline(); // find node marker by id - var nodeMarker = nodeMarkers[id]; + const nodeMarker = nodeMarkers[id]; if(!nodeMarker){ return; } - // add circle around node - selectedNodeOutlineCircle = L.circle(nodeMarker.getLatLng(), { - radius: 1200, // 1.2km - }).addTo(map); + // find node by id + const node = findNodeById(id); + if(!node){ + return; + } + + // add position precision circle around node + if(node.position_precision != null && node.position_precision > 0 && node.position_precision < 32){ + selectedNodeOutlineCircle = L.circle(nodeMarker.getLatLng(), { + radius: getPositionPrecisionInMeters(node.position_precision), + }).addTo(map); + } } @@ -3552,7 +3560,7 @@ }); } - // show node info sidebar when clicking node marker + // show node info tooltip when clicking node marker marker.on("click", function(event) { // close all other popups and tooltips @@ -3565,6 +3573,9 @@ return; } + // show position precision outline + showNodeOutline(node.node_id); + // open tooltip for node map.openTooltip(getTooltipContentForNode(node), event.target.getLatLng(), { interactive: true, // allow clicking buttons inside tooltip