From cf2d06c543fed5c32a3bdbcdba7efa7fa031d02a Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 24 Nov 2021 19:47:01 +0000 Subject: [PATCH] let SDIC be 4 chars --- README.md | 1 + worldmap.js | 13 +++++++------ worldmap/worldmap.js | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7299fc0..65b2fe0 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ map web page for plotting "things" on. ### Updates +- v2.21.6 - Let SIDC/icon short code be only 4 chars long - v2.21.5 - Fix handling of "old" ship nav to ship navigation - v2.21.4 - Fix speed leader length. Add transparentPixels option.. - v2.21.3 - Add zoom to bounds action. Adjust map layers max zoom levels. diff --git a/worldmap.js b/worldmap.js index e84a8ba..4982933 100644 --- a/worldmap.js +++ b/worldmap.js @@ -151,13 +151,11 @@ module.exports = function(RED) { var height = config.height; if (height == 0) { height = 10; } var size = ui.getSizes(); - var frameWidth = (size.sx +size.cx) * width - size.cx; - var frameHeight = (size.sy +size.cy) * height - size.cy; + var frameWidth = (size.sx + size.cx) * width - size.cx; + var frameHeight = (size.sy + size.cy) * height - size.cy; var url = encodeURI(config.path); var html = `
- -
-`; +`; return html; } @@ -219,7 +217,8 @@ module.exports = function(RED) { } setImmediate(function() { RED.nodes.registerType("ui_worldmap", UIWorldMap) }); } - }, 250); + }, 100); + var WorldMapIn = function(n) { RED.nodes.createNode(this,n); @@ -288,6 +287,7 @@ module.exports = function(RED) { } RED.nodes.registerType("worldmap in",WorldMapIn); + var WorldMapTracks = function(n) { RED.nodes.createNode(this,n); this.depth = parseInt(Number(n.depth) || 20); @@ -407,6 +407,7 @@ module.exports = function(RED) { } RED.nodes.registerType("worldmap-tracks",WorldMapTracks); + var WorldMapHull = function(n) { RED.nodes.createNode(this,n); this.prop = n.prop || "layer"; diff --git a/worldmap/worldmap.js b/worldmap/worldmap.js index ae7544e..dc3491e 100644 --- a/worldmap/worldmap.js +++ b/worldmap/worldmap.js @@ -668,7 +668,7 @@ var addThing = function() { var colo = (bits[3] || "#910000").trim(); var hdg = parseFloat(bits[4] || 0); var drag = true; - var regi = /^[S,G,E,I,O][A-Z]{4}.*/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}; if (regi.test(icon)) { d.SIDC = (icon.toUpperCase()+"------------").substr(0,12);