Better scale NATO symbols

This commit is contained in:
Dave Conway-Jones 2018-09-10 21:03:52 -04:00
parent d47692f938
commit 0b7be08e70
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
5 changed files with 52 additions and 49 deletions

View File

@ -97,7 +97,7 @@ To do this you need to supply a `msg.SIDC` instead of an icon, for example:
msg.payload = { name: "Emergency Medical Operation",
lat: 51.05,
lon: -1.35,
SIDC:"ENOPA-------",
SIDC: "ENOPA-------",
options: { fillOpacity:0.8 }
}

View File

@ -1,8 +1,8 @@
[
{
"id": "104f9b89.5daf04",
"id": "fa3d2b67.0d5078",
"type": "worldmap",
"z": "5ab56e5e.449a5",
"z": "dfe4ec36.0a5a5",
"name": "",
"lat": "",
"lon": "",
@ -12,14 +12,14 @@
"maxage": "",
"usermenu": "hide",
"panit": "true",
"x": 490,
"y": 280,
"x": 770,
"y": 1120,
"wires": []
},
{
"id": "7892d55a.40864c",
"id": "4d3000c1.a4c81",
"type": "inject",
"z": "5ab56e5e.449a5",
"z": "dfe4ec36.0a5a5",
"name": "",
"topic": "",
"payload": "",
@ -27,54 +27,55 @@
"repeat": "",
"crontab": "",
"once": false,
"x": 130,
"y": 220,
"x": 410,
"y": 1060,
"wires": [
[
"45dc04c5.811fcc"
"31c1899.d3d0b76"
]
]
},
{
"id": "45dc04c5.811fcc",
"id": "31c1899.d3d0b76",
"type": "function",
"z": "5ab56e5e.449a5",
"z": "dfe4ec36.0a5a5",
"name": "",
"func": "// create random position\nvar lat = 51 + Math.random() * 0.2;\nvar lon = -1.45 + Math.random() * 0.2;\nmsg.payload={lat:lat, lon:lon, name:\"Mike\", icon:\"male\", url:\"<a href=\\\"/red/ui/#/0\\\">IBM link</a>\"};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 310,
"y": 280,
"x": 590,
"y": 1120,
"wires": [
[
"104f9b89.5daf04"
"fa3d2b67.0d5078"
]
]
},
{
"id": "39ae2a4d.5a6f06",
"id": "28f4bf19.04c6c",
"type": "inject",
"z": "5ab56e5e.449a5",
"z": "dfe4ec36.0a5a5",
"name": "",
"topic": "",
"payload": "/red/worldmap",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": true,
"x": 140,
"y": 340,
"onceDelay": "",
"x": 390,
"y": 1180,
"wires": [
[
"a8660ccf.d7166"
"dd8e0887.5b4888"
]
]
},
{
"id": "be72c0ae.5925b",
"id": "ce1dac49.66168",
"type": "ui_template",
"z": "5ab56e5e.449a5",
"group": "c60f4e05.ebb48",
"z": "dfe4ec36.0a5a5",
"group": "88c32df0.a0af9",
"name": "",
"order": 0,
"width": "6",
@ -82,36 +83,37 @@
"format": "<div ng-bind-html=\"msg.payload | trusted\"></div>",
"storeOutMessages": true,
"fwdInMessages": true,
"x": 480,
"y": 340,
"templateScope": "local",
"x": 760,
"y": 1180,
"wires": [
[]
]
},
{
"id": "a8660ccf.d7166",
"id": "dd8e0887.5b4888",
"type": "template",
"z": "5ab56e5e.449a5",
"z": "dfe4ec36.0a5a5",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "<iframe src={{{payload}}} height=300px ></iframe>",
"x": 310,
"y": 340,
"template": "<iframe src=\"/worldmap\" height=300px ></iframe>",
"x": 590,
"y": 1180,
"wires": [
[
"be72c0ae.5925b"
"ce1dac49.66168"
]
]
},
{
"id": "79411e5e.1af57",
"id": "ef0d9eba.478a5",
"type": "ui_button",
"z": "5ab56e5e.449a5",
"z": "dfe4ec36.0a5a5",
"name": "",
"group": "c60f4e05.ebb48",
"group": "88c32df0.a0af9",
"order": 0,
"width": 0,
"height": 0,
@ -121,37 +123,37 @@
"payload": "",
"payloadType": "str",
"topic": "",
"x": 130,
"y": 280,
"x": 410,
"y": 1120,
"wires": [
[
"45dc04c5.811fcc"
"31c1899.d3d0b76"
]
]
},
{
"id": "235ad210.492b0e",
"id": "72196d3b.8a5724",
"type": "comment",
"z": "5ab56e5e.449a5",
"z": "dfe4ec36.0a5a5",
"name": "How to embed Map in Dashboard",
"info": "This example shows how to embed the Worldmap \ninto a template node within the `node-red-dashboard`\n\nThe first flow creates a dashboard button that \ngenerates a randon position, with the required \nicon, and passes that to the worldmap. The\nmap is configured to automatically pan to the\nposition of any point that arrives.\n\nThe second flow initialise the dashboard template\nwith the initial map and sets it to a more square shape\nby adjusting the height.",
"x": 180,
"y": 160,
"x": 460,
"y": 1000,
"wires": []
},
{
"id": "c60f4e05.ebb48",
"id": "88c32df0.a0af9",
"type": "ui_group",
"z": "5ab56e5e.449a5",
"z": "dfe4ec36.0a5a5",
"name": "Default",
"tab": "6a3aec18.0bc474",
"tab": "f58bb1b.fd6cc5",
"disp": true,
"width": "6"
},
{
"id": "6a3aec18.0bc474",
"id": "f58bb1b.fd6cc5",
"type": "ui_tab",
"z": "5ab56e5e.449a5",
"z": "dfe4ec36.0a5a5",
"name": "Home",
"icon": "dashboard"
}

View File

@ -1,6 +1,6 @@
{
"name": "node-red-contrib-web-worldmap",
"version": "1.3.6",
"version": "1.3.7",
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies": {
"cgi": "0.3.1",

View File

@ -1018,6 +1018,7 @@ function setMarker(data) {
// Now that we have a symbol we can ask for the echelon and set the symbol size
var opts = data.options || {};
opts.size = opts.size || iconSz[myMarker.getProperties().echelon] || 30;
opts.size = opts.size - 30) / 2 + 30;
opts.size = opts.size * (opts.scale || 1);
myMarker = myMarker.setOptions(opts);
var myicon = L.icon({

View File

@ -1,5 +1,5 @@
CACHE MANIFEST
# date: July 17th 2018 - v1.3.6
# date: Sept 10th 2018 - v1.3.7
CACHE:
index.html