let SDIC be 4 chars

This commit is contained in:
Dave Conway-Jones 2021-11-24 19:47:01 +00:00
parent 7d7b2e2e6e
commit cf2d06c543
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
3 changed files with 9 additions and 7 deletions

View File

@ -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.

View File

@ -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 = `<style>.nr-dashboard-ui_worldmap{padding:0;}</style><div style="overflow:hidden;">
<iframe src="${url}" width="${frameWidth}px" height="${frameHeight}px" style="border:none;"></iframe>
</div>
`;
<iframe src="${url}" width="${frameWidth}px" height="${frameHeight}px" style="border:none;"></iframe></div>`;
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";

View File

@ -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);