diff --git a/CHANGELOG.md b/CHANGELOG.md index b48da11..e4bd25d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ### Change Log for Node-RED Worldmap + - v1.5.16 - Allow setting panlock, zoomlock and hiderightclick via commands - Issue #60 + - v1.5.15 - Allow setting clusterAt to 0 to fully disable it - Issue #61 - v1.5.14 - Stop delete marker feedback to allow updating multiple maps - Issue #59 - v1.5.13 - Send click message to websocket on marker click - Issue #56, #57 - v1.5.11 - Let search also try geocoding lookup if not found in marks. diff --git a/README.md b/README.md index b573b5a..cef5ded 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ map web page for plotting "things" on. ### Updates +- v1.5.16 - Allow setting panlock, zoomlock and hiderightclick via commands - Issue #60 - v1.5.15 - Allow setting clusterAt to 0 to fully disable it - Issue #61 - v1.5.14 - Stop delete marker feedback to allow updating multiple maps - Issue #59 - v1.5.13 - Send click message to websocket on marker click - Issue #56, #57 @@ -231,7 +232,7 @@ All these events generate messages that can be received by using a **worldmap in ## Control -You can also control the map via the node, by sending in a msg.payload containing a **command** object. +You can also control the map via the node, by sending in a msg.payload containing a **command** object. Multiple parameters can be specified in one command. Optional properties include @@ -252,6 +253,9 @@ Optional properties include - **bounds** - sets the bounds of an Overlay-Image. 2 Dimensional Array that defines the top-left and bottom-right Corners (lat/lng Points) - **heatmap** - set heatmap options object see https://github.com/Leaflet/Leaflet.heat#reference - **clear** - layer name - to clear a complete layer and remove from layer menu + - **panlock** - lock the map area to the current visible area. - `{command:{panlock:true}}` + - **zoomlock** - locks the zoom control to the current value and removes zoom control - `{command:{zoomlock:true}}` + - **hiderightclick** - disables the right click that allows adding points to the map - `{command:{hiderightclick:true}}` #### To switch layer, move map and zoom diff --git a/package.json b/package.json index 03ec294..a151186 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-web-worldmap", - "version": "1.5.15", + "version": "1.5.16", "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.html b/worldmap.html index 95a69d9..5729fa1 100644 --- a/worldmap.html +++ b/worldmap.html @@ -51,19 +51,31 @@
⌘⇧m
- ctrl-shift-m
will load the map in a new tab.⌘⇧m
- ctrl-shift-m
will load the m
speed
: combined with bearing, draws a vector.bearing
: combined with speed, draws a vector.accuracy
: combined with bearing, draws a polygon of possible direction.icon
: font awesome icon nameicon
: font awesome icon nameiconColor
: standard CSS color name or #rrggbb hex value.SIDC
: NATO symbology code (instead of icon).bulding
: OSMBuildings GeoJSON object.⌘⇧m
- ctrl-shift-m
will load the m
Any other sub-properties of msg.payload
will be added to the icon popup text box as extra information.
Icons of type plane, ship, car, uav or arrow will use built in SVG icons that align to the
bearing
value.
Font Awesome (fa-icons 4.7) can also be used, as can NATO symbology codes (SIDC).
+Font Awesome (fa-icons 4.7) can also be used, as can NATO symbology codes (SIDC).
See the README for further details and examples of icons and commands for drawing lines and areas, and to add layers and to control the map remotely, including how to use a local map server.
@@ -137,6 +149,8 @@ then by default⌘⇧m
- ctrl-shift-m
will load the m
usermenu: {value:"show"},
layers: {value:"show"},
panit: {value:"false"},
+ panlock: {value:"false"},
+ zoomlock: {value:"false"},
path: {value:"/worldmap"}
},
inputs:1,
diff --git a/worldmap.js b/worldmap.js
index 6e4d235..8a03adb 100644
--- a/worldmap.js
+++ b/worldmap.js
@@ -32,8 +32,10 @@ module.exports = function(RED) {
this.cluster = n.cluster || "";
this.maxage = n.maxage || "";
this.showmenu = n.usermenu || "show";
- this.panit = n.panit || "false";
this.layers = n.layers || "show";
+ this.panlock = n.panlock || "false";
+ this.zoomlock = n.zoomlock || "false";
+ this.panit = n.panit || "false";
this.path = n.path || "/worldmap";
if (this.path.charAt(0) != "/") { this.path = "/" + this.path; }
if (!sockets[this.path]) {
@@ -63,6 +65,8 @@ module.exports = function(RED) {
if (node.maxage && node.maxage.length > 0) { c.maxage = node.maxage; }
c.showmenu = node.showmenu;
c.panit = node.panit;
+ c.panlock = node.panlock;
+ c.zoomlock = node.zoomlock;
c.showlayers = node.layers;
client.write(JSON.stringify({command:c}));
}
diff --git a/worldmap/index.html b/worldmap/index.html
index 0ae47d0..26a3174 100644
--- a/worldmap/index.html
+++ b/worldmap/index.html
@@ -307,7 +307,7 @@ function doHeatAll() {
var lockit = false;
var mb = new L.LatLngBounds([[-120,-360],[120,360]]);
function doLock() {
- if (lockit) {
+ if (lockit === true) {
lockit = false;
mb = new L.LatLngBounds([[-120,-360],[120,360]]);
}
@@ -595,6 +595,7 @@ map.on('zoomend', function() {
var rightmenuMap = L.popup({keepInView:true, minWidth:250}).setContent("Add marker