diff --git a/README.md b/README.md index d6b4448..9d94c57 100644 --- a/README.md +++ b/README.md @@ -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 } } diff --git a/examples/Map in Dashboard.json b/examples/Map in Dashboard.json index ae68556..ce5a470 100644 --- a/examples/Map in Dashboard.json +++ b/examples/Map in Dashboard.json @@ -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:\"IBM link\"};\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": "
", "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": "", - "x": 310, - "y": 340, + "template": "", + "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" } diff --git a/package.json b/package.json index 720c7be..daa2151 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/worldmap/index.html b/worldmap/index.html index 72f8095..46b1b9f 100644 --- a/worldmap/index.html +++ b/worldmap/index.html @@ -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({ diff --git a/worldmap/worldmap.appcache b/worldmap/worldmap.appcache index 6f3f080..87eaf9f 100644 --- a/worldmap/worldmap.appcache +++ b/worldmap/worldmap.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# date: July 17th 2018 - v1.3.6 +# date: Sept 10th 2018 - v1.3.7 CACHE: index.html