Fix saving fo custom map option

This commit is contained in:
Dave Conway-Jones 2021-12-16 21:45:21 +00:00
parent 38cf0b20f4
commit 1a4951594d
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
5 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,6 @@
### Change Log for Node-RED Worldmap ### Change Log for Node-RED Worldmap
- v2.23.1 - Fix saving of custom map layer
- v2.23.0 - Give logo and id so it can be overridden by toplogo command. PR #188. - v2.23.0 - Give logo and id so it can be overridden by toplogo command. PR #188.
- v2.22.3 - Don't show empty popup for geojson object. Issue #186. Add wobble to null island. - v2.22.3 - Don't show empty popup for geojson object. Issue #186. Add wobble to null island.
- v2.22.2 - Be more tolerant of speed string types - v2.22.2 - Be more tolerant of speed string types

View File

@ -11,6 +11,7 @@ map web page for plotting "things" on.
### Updates ### Updates
- v2.23.1 - Fix saving of custom map layer
- v2.23.0 - Give logo and id so it can be overridden by toplogo command. PR #188. - v2.23.0 - Give logo and id so it can be overridden by toplogo command. PR #188.
- v2.22.3 - Don't show empty popup for geojson object. Issue #186. Add wobble to null island. - v2.22.3 - Don't show empty popup for geojson object. Issue #186. Add wobble to null island.
- v2.22.2 - Be more tolerant of speed string types - v2.22.2 - Be more tolerant of speed string types

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-contrib-web-worldmap", "name": "node-red-contrib-web-worldmap",
"version": "2.23.0", "version": "2.23.1",
"description": "A Node-RED node to provide a web page of a world map for plotting things on.", "description": "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies": { "dependencies": {
"@turf/bezier-spline": "~6.5.0", "@turf/bezier-spline": "~6.5.0",

View File

@ -383,6 +383,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
return 'The map can be found [here]('+RED.settings.httpNodeRoot.slice(0,-1)+this.path+').'; return 'The map can be found [here]('+RED.settings.httpNodeRoot.slice(0,-1)+this.path+').';
}, },
oneditprepare: function() { oneditprepare: function() {
var mshort;
if (this.maplist === undefined) { if (this.maplist === undefined) {
$("#node-input-maplist").val("OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW"); $("#node-input-maplist").val("OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW");
this.maplist = "OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW"; this.maplist = "OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW";
@ -398,7 +399,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
}]}); }]});
$("#node-input-layer").typedInput({type:"laye", types:[{ $("#node-input-layer").typedInput({type:"laye", types:[{
value: "laye", value: "laye",
options: mlist options: mshort
}]}); }]});
$("#node-input-overlist").typedInput({type:"overlay", types:[{ $("#node-input-overlist").typedInput({type:"overlay", types:[{
value: "overlay", value: "overlay",
@ -406,7 +407,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
options: olist options: olist
}]}); }]});
$("#node-input-maplist").on('change', function(event, type, value) { $("#node-input-maplist").on('change', function(event, type, value) {
var mshort = mlist.filter(e => value.indexOf(e.value)!==-1); mshort = mlist.filter(e => value.indexOf(e.value)!==-1);
mshort.push({ value:"Custom", label:"Custom Map Provider" }); mshort.push({ value:"Custom", label:"Custom Map Provider" });
$("#node-input-layer").typedInput("types", [{ $("#node-input-layer").typedInput("types", [{
value: "laye", value: "laye",
@ -493,6 +494,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
return this.name?"node_label_italic":""; return this.name?"node_label_italic":"";
}, },
oneditprepare: function() { oneditprepare: function() {
var mshort;
if (this.maplist === undefined) { if (this.maplist === undefined) {
$("#node-input-maplist").val("OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW"); $("#node-input-maplist").val("OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW");
this.maplist = "OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW"; this.maplist = "OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW";
@ -508,7 +510,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
}]}); }]});
$("#node-input-layer").typedInput({type:"laye", types:[{ $("#node-input-layer").typedInput({type:"laye", types:[{
value: "laye", value: "laye",
options: mlist options: mshort
}]}); }]});
$("#node-input-overlist").typedInput({type:"overlay", types:[{ $("#node-input-overlist").typedInput({type:"overlay", types:[{
value: "overlay", value: "overlay",
@ -516,7 +518,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
options: olist options: olist
}]}); }]});
$("#node-input-maplist").on('change', function(event, type, value) { $("#node-input-maplist").on('change', function(event, type, value) {
var mshort = mlist.filter(e => value.indexOf(e.value)!==-1); mshort = mlist.filter(e => value.indexOf(e.value)!==-1);
mshort.push({ value:"Custom", label:"Custom Map Provider" }); mshort.push({ value:"Custom", label:"Custom Map Provider" });
$("#node-input-layer").typedInput("types", [{ $("#node-input-layer").typedInput("types", [{
value: "laye", value: "laye",

View File

@ -673,7 +673,7 @@ var addThing = function() {
var hdg = parseFloat(bits[4] || 0); var hdg = parseFloat(bits[4] || 0);
var drag = true; var drag = true;
var regi = /^[S,G,E,I,O][A-Z]{3}.*/i; // if it looks like a SIDC code var regi = /^[S,G,E,I,O][A-Z]{3}.*/i; // if it looks like a SIDC code
var d = {action:"point", name:bits[0].trim(), layer:lay, draggable:drag, lat:rclk.lat, lon:rclk.lng, hdg:hdg}; var d = {action:"point", name:bits[0].trim(), layer:lay, draggable:drag, lat:rclk.lat, lon:rclk.lng, hdg:hdg, ttl:0 };
if (regi.test(icon)) { if (regi.test(icon)) {
d.SIDC = (icon.toUpperCase()+"------------").substr(0,12); d.SIDC = (icon.toUpperCase()+"------------").substr(0,12);
} }