make sure maxage exists before setting value
This commit is contained in:
parent
e1b0572170
commit
58d6662bd8
@ -1,5 +1,6 @@
|
||||
### Change Log for Node-RED Worldmap
|
||||
|
||||
- v2.0.9 - Only update maxage on screen once it exists
|
||||
- v2.0.8 - Drop beta flag, re-organise index, js and css files. Now using leaflet 1.4
|
||||
- v2.0.7-beta - Switch Ruler control to be independent of Draw library.
|
||||
- v2.0.6-beta - Re-enable editing of draw layer, add rectangles to lines and areas. Make individual objects editable.
|
||||
|
@ -9,6 +9,7 @@ map web page for plotting "things" on.
|
||||
|
||||
### Updates
|
||||
|
||||
- v2.0.9 - Only update maxage on screen once it exists
|
||||
- v2.0.8 - Drop beta flag, re-organise index, js and css files. Now using leaflet 1.4
|
||||
- v2.0.7-beta - Switch Ruler control to be independent of Draw library.
|
||||
- v2.0.6-beta - Re-enable editing of draw layer, add rectangles to lines and areas. Make individual objects editable.
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red-contrib-web-worldmap",
|
||||
"version": "2.0.8",
|
||||
"version": "2.0.9",
|
||||
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
|
||||
"dependencies": {
|
||||
"cgi": "0.3.1",
|
||||
|
@ -104,24 +104,6 @@ document.addEventListener ("keydown", function (ev) {
|
||||
}
|
||||
});
|
||||
|
||||
if (showUserMenu) {
|
||||
if ( window.localStorage.hasOwnProperty("lastpos") ) {
|
||||
var sp = JSON.parse(window.localStorage.getItem("lastpos"));
|
||||
startpos = [ sp.lat, sp.lng ];
|
||||
}
|
||||
if ( window.localStorage.hasOwnProperty("lastzoom") ) {
|
||||
startzoom = window.localStorage.getItem("lastzoom");
|
||||
}
|
||||
// if ( window.localStorage.hasOwnProperty("clusterat") ) {
|
||||
// clusterAt = window.localStorage.getItem("clusterat");
|
||||
// document.getElementById("setclus").value = clusterAt;
|
||||
// }
|
||||
if ( window.localStorage.hasOwnProperty("maxage") ) {
|
||||
maxage = window.localStorage.getItem("maxage");
|
||||
document.getElementById("maxage").value = maxage;
|
||||
}
|
||||
}
|
||||
|
||||
// Create the Initial Map object.
|
||||
map = new L.map('map').setView(startpos, startzoom);
|
||||
|
||||
@ -203,6 +185,24 @@ if (!inIframe) { helpText += `<tr><td style="cursor:default"><span id="showHelp"
|
||||
else { helpText += `</table>` }
|
||||
document.getElementById('menu').innerHTML = helpText;
|
||||
|
||||
if (showUserMenu) {
|
||||
if ( window.localStorage.hasOwnProperty("lastpos") ) {
|
||||
var sp = JSON.parse(window.localStorage.getItem("lastpos"));
|
||||
startpos = [ sp.lat, sp.lng ];
|
||||
}
|
||||
if ( window.localStorage.hasOwnProperty("lastzoom") ) {
|
||||
startzoom = window.localStorage.getItem("lastzoom");
|
||||
}
|
||||
// if ( window.localStorage.hasOwnProperty("clusterat") ) {
|
||||
// clusterAt = window.localStorage.getItem("clusterat");
|
||||
// document.getElementById("setclus").value = clusterAt;
|
||||
// }
|
||||
if ( window.localStorage.hasOwnProperty("maxage") ) {
|
||||
maxage = window.localStorage.getItem("maxage");
|
||||
document.getElementById("maxage").value = maxage;
|
||||
}
|
||||
}
|
||||
|
||||
// Add graticule
|
||||
var showGrid = false;
|
||||
var Lgrid = L.latlngGraticule({
|
||||
|
Loading…
Reference in New Issue
Block a user