Let worldmap-in layer events be selectable
This commit is contained in:
parent
2363a767b9
commit
fdfe82ec37
@ -1,5 +1,7 @@
|
||||
### Change Log for Node-RED Worldmap
|
||||
|
||||
- v2.22.0 - Separate out layer events in worldmap in
|
||||
- v2.21.9 - Unbreak Drawing layer that I must have broken recently
|
||||
- v2.21.8 - 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.
|
||||
|
16
README.md
16
README.md
@ -11,6 +11,8 @@ map web page for plotting "things" on.
|
||||
|
||||
### Updates
|
||||
|
||||
- v2.22.0 - Separate out layer events in worldmap in
|
||||
- v2.21.9 - Unbreak Drawing layer that I must have broken recently
|
||||
- v2.21.8 - 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..
|
||||
@ -29,13 +31,6 @@ map web page for plotting "things" on.
|
||||
- v2.16.3 - Ensure polygons can be deleted.
|
||||
- v2.16.2 - Better handling of unpacked kmz objects.
|
||||
- v2.16.0 - Allow specifying custom base map server.
|
||||
- v2.15.8 - Adjust ui check timing for UI worldmap.
|
||||
- v2.15.7 - Tidy up geoJson handling a bit more.
|
||||
- v2.15.5 - Fix SIDC icons to accept unicoded icons as labels.
|
||||
- v2.15.4 - Let clear heatmap command do what it says.
|
||||
- v2.15.3 - Fix panit command to work, try to use alt units, popup alignments.
|
||||
- v2.15.0 - Let speed be text and specify units if required (kt,kn,knots,mph,kmh,kph) default m/s.
|
||||
- v2.14.0 - Let geojson features be clickable if added as overlay.
|
||||
|
||||
- see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list of changes.
|
||||
|
||||
@ -464,6 +459,13 @@ Or with an input box
|
||||
contextmenu: '<input name="slide1" type="range" min="1" max="100" value="50" onchange=\'feedback(this.name,this.value,"myEventName")\' >'
|
||||
}
|
||||
|
||||
Example simple form
|
||||
|
||||
```
|
||||
[{"id":"7351100bacb1f5fe","type":"function","z":"4aa2ed2fd1b11362","name":"","func":"msg.payload = { command: {\ncontextmenu: String.raw`\nText <input type=\"text\" id=\"sometext\" value=\"hello\"><br/>\nNumber <input type=\"number\" id=\"somenum\" value=\"5\"><br/>\n<input type=\"button\" value=\"Send\" onclick=\n'feedback(\"myform\",{\n \"st\":document.getElementById(\"sometext\").value,\n \"sn\":document.getElementById(\"somenum\").value,\n})'\n>\n`\n}}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":360,"wires":[["a6a82f2e8efc44fc"]]},{"id":"7b595f0c8f6ac710","type":"worldmap in","z":"4aa2ed2fd1b11362","name":"","path":"/worldmap","events":"connect","x":195,"y":360,"wires":[["7351100bacb1f5fe"]]}]
|
||||
```
|
||||
|
||||
|
||||
See the section on **Utility Functions** for details of the feedback function.
|
||||
|
||||
#### To add and remove a legend
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red-contrib-web-worldmap",
|
||||
"version": "2.21.8",
|
||||
"version": "2.22.0",
|
||||
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
|
||||
"dependencies": {
|
||||
"@turf/bezier-spline": "~6.5.0",
|
||||
|
@ -604,7 +604,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
path: {value:"/worldmap"},
|
||||
events: {value:"connect,disconnect,point,bounds,files,draw,other"}
|
||||
events: {value:"connect,disconnect,point,layer,bounds,files,draw,other"}
|
||||
},
|
||||
inputs:0,
|
||||
outputs:1,
|
||||
@ -620,7 +620,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
||||
},
|
||||
oneditprepare: function() {
|
||||
if ($("#node-input-events").val() === "all") {
|
||||
$("#node-input-events").val("connect,disconnect,point,bounds,files,draw,other");
|
||||
$("#node-input-events").val("connect,disconnect,point,layer,bounds,files,draw,other");
|
||||
}
|
||||
$("#node-input-events").typedInput({type:"event", types:[{
|
||||
value: "event",
|
||||
@ -629,6 +629,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
||||
{ value: "connect", label: "Connect"},
|
||||
{ value: "disconnect", label: "Disconnect"},
|
||||
{ value: "point", label: "Add, move, delete point"},
|
||||
{ value: "layer", label: "Add, remove layers"},
|
||||
{ value: "bounds", label: "Boundary change"},
|
||||
{ value: "files", label: "File drop"},
|
||||
{ value: "draw", label: "Drawing"},
|
||||
|
@ -252,6 +252,9 @@ module.exports = function(RED) {
|
||||
if ((node.events.indexOf("point")!==-1) && ((message.action === "point")||(message.action === "move")||(message.action === "delete") )) {
|
||||
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
||||
}
|
||||
if ((node.events.indexOf("layer")!==-1) && ((message.action === "layer") )) {
|
||||
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
||||
}
|
||||
if ((node.events.indexOf("files")!==-1) && (message.action === "file")) {
|
||||
message.content = Buffer.from(message.content.split('base64,')[1], 'base64');
|
||||
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
||||
|
@ -28,7 +28,10 @@ var heat;
|
||||
var minimap;
|
||||
var sidebyside;
|
||||
var layercontrol;
|
||||
var drawControl;
|
||||
var drawingColour = "#910000";
|
||||
var sendRoute;
|
||||
var sendDrawing;
|
||||
|
||||
var iconSz = {
|
||||
"Team/Crew": 24,
|
||||
@ -930,7 +933,7 @@ var addOverlays = function(overlist) {
|
||||
overlays["drawing"] = layers["_drawing"];
|
||||
map.options.drawControlTooltips = false;
|
||||
var drawCount = 0;
|
||||
var drawControl = new L.Control.Draw({
|
||||
drawControl = new L.Control.Draw({
|
||||
draw: {
|
||||
polyline: { shapeOptions: { clickable:true } },
|
||||
marker: false,
|
||||
@ -996,7 +999,7 @@ var addOverlays = function(overlist) {
|
||||
setTimeout(function() {map.openPopup(rightmenuMarker)},25);
|
||||
});
|
||||
|
||||
var sendDrawing = function(n) {
|
||||
sendDrawing = function(n) {
|
||||
var thing = document.getElementById('dinput').value;
|
||||
map.closePopup();
|
||||
shape.m.name = thing;
|
||||
@ -1079,7 +1082,7 @@ var addOverlays = function(overlist) {
|
||||
return numbers;
|
||||
}
|
||||
|
||||
var sendRoute = function(n) {
|
||||
sendRoute = function(n) {
|
||||
var p = (polygons[n]._latlngs.map(function(x) {
|
||||
return x.lng+","+x.lat;
|
||||
})).join(';');
|
||||
|
Loading…
Reference in New Issue
Block a user