diff --git a/html/early.js b/html/early.js index 5975ea5..255d9a0 100644 --- a/html/early.js +++ b/html/early.js @@ -179,6 +179,17 @@ if (0 && window.self != window.top) { } } +const lopaStore = new Proxy(loStore, { + get(loStore, key) { + key = String(window.location.origin) + String(window.location.pathname) + key; + return loStore[key]; + }, + set(loStore, key, value) { + key = String(window.location.origin) + String(window.location.pathname) + key; + return loStore[key] = value; + }, +}); + let firstError = true; if (usp.has('showerrors') || usp.has('jse')) { window.onerror = function (msg, url, lineNo, columnNo, error) { diff --git a/html/script.js b/html/script.js index e56450d..18b1b09 100644 --- a/html/script.js +++ b/html/script.js @@ -2788,10 +2788,10 @@ function showHideButtons() { // Initalizes the map and starts up our timers to call various functions function initMap() { - CenterLon = Number(loStore['CenterLon']) || DefaultCenterLon; - CenterLat = Number(loStore['CenterLat']) || DefaultCenterLat; + CenterLon = Number(lopaStore['CenterLon']) || DefaultCenterLon; + CenterLat = Number(lopaStore['CenterLat']) || DefaultCenterLat; //console.log("initMap Centerlat: " + CenterLat); - g.zoomLvl = Number(loStore['zoomLvl']) || DefaultZoomLvl; + g.zoomLvl = Number(lopaStore['zoomLvl']) || DefaultZoomLvl; g.zoomLvlCache = g.zoomLvl; // always hide this, it really only shows the number of positions saved @@ -4708,9 +4708,9 @@ function resetMap() { CenterLat = DefaultCenterLat; } // Reset loStore values and map settings - loStore['CenterLat'] = CenterLat - loStore['CenterLon'] = CenterLon - //loStore['zoomLvl'] = g.zoomLvl = DefaultZoomLvl; + lopaStore['CenterLat'] = CenterLat + lopaStore['CenterLon'] = CenterLon + //lopaStore['zoomLvl'] = g.zoomLvl = DefaultZoomLvl; // Set and refresh //OLMap.getView().setZoom(g.zoomLvl); @@ -5650,7 +5650,7 @@ function changeZoom(init) { if (!init && Math.abs(g.zoomLvl-g.zoomLvlCache) < 0.4) return; - loStore['zoomLvl'] = g.zoomLvl; + lopaStore['zoomLvl'] = g.zoomLvl; g.zoomLvlCache = g.zoomLvl; if (!init && showTrace) @@ -5712,8 +5712,8 @@ function changeCenter(init) { return; } - loStore['CenterLon'] = CenterLon = center[0]; - loStore['CenterLat'] = CenterLat = center[1]; + lopaStore['CenterLon'] = CenterLon = center[0]; + lopaStore['CenterLat'] = CenterLat = center[1]; if (!init) { updateAddressBar();