diff --git a/html/script.js b/html/script.js index 1fc1407..7cce52c 100644 --- a/html/script.js +++ b/html/script.js @@ -100,7 +100,7 @@ let userScale = 1; let iconScale = 1; let labelScale = 1; let newWidth = lineWidth; -let SiteOverride = false; +let SiteOverride = (SiteLat != null && SiteLon != null); let onJumpInput = null; let labelFill = null; let blackFill = null; @@ -148,7 +148,6 @@ const renderBuffer = 60; let shareLink = ''; - let CenterLat = 0; let CenterLon = 0; let zoomLvl = 5; @@ -712,7 +711,7 @@ function initialize() { trace_hist_only = true; if (receiverJson.json_trace_interval < 2) traces_high_res = true; - if (receiverJson.lat != null && (SiteLat == null || SiteLon == null)) { + if (receiverJson.lat != null && !SiteOverride) { //console.log("receiver.json lat: " + receiverJson.lat) SiteLat = receiverJson.lat; SiteLon = receiverJson.lon; @@ -840,11 +839,9 @@ function initPage() { let lat = parseFloat(usp.get('SiteLat')); let lon = parseFloat(usp.get('SiteLon')); if (!isNaN(lat) && !isNaN(lon)) { - if (true || usp.has('SiteNosave')) { - SiteLat = CenterLat = DefaultCenterLat = lat; - SiteLon = CenterLon = DefaultCenterLon = lon; - SiteOverride = true; - } + SiteLat = CenterLat = DefaultCenterLat = lat; + SiteLon = CenterLon = DefaultCenterLon = lon; + SiteOverride = true; loStore['SiteLat'] = lat; loStore['SiteLon'] = lon; } @@ -6668,6 +6665,9 @@ function setLineWidth() { } let lastCallLocationChange = 0; function onLocationChange(position) { + if (SiteOverride) { + return; + } lastCallLocationChange = new Date().getTime(); changeCenter(); const moveMap = (Math.abs(SiteLat - CenterLat) < 0.000001 && Math.abs(SiteLon - CenterLon) < 0.000001);