From 1aff2e281e9543059d972aa0185159934a2bd2f6 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Thu, 25 Mar 2021 13:42:23 +0100 Subject: [PATCH] remove unnecessary address bar updates in showTrace mode --- html/script.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/html/script.js b/html/script.js index ac04db6..dbdbb15 100644 --- a/html/script.js +++ b/html/script.js @@ -4136,11 +4136,14 @@ function changeCenter(init) { const rawCenter = OLMap.getView().getCenter(); const center = ol.proj.toLonLat(rawCenter); + const centerChanged = (CenterLon != center[0] || CenterLat != center[1]); + localStorage['CenterLon'] = CenterLon = center[0]; localStorage['CenterLat'] = CenterLat = center[1]; - if (!init && showTrace) + if (!init && showTrace && centerChanged) { updateAddressBar(); + } if (rawCenter[0] < OLProj.extent_[0] || rawCenter[0] > OLProj.extent_[2]) { OLMap.getView().setCenter(ol.proj.fromLonLat(center));