From e68f71d9c196dba7bb212168df069cd5b8aa3d2f Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sat, 17 Nov 2018 12:10:46 +0000 Subject: [PATCH] Send marker click to websocket to close #56 --- CHANGELOG.md | 3 ++- README.md | 12 +++--------- package.json | 2 +- worldmap.html | 2 +- worldmap/index.html | 3 +++ worldmap/worldmap.appcache | 2 +- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e571b07..d4ed4de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### Change Log for Node-RED Worldmap - - v1.5.11 - Let search also try geocoding lookup if not marks found. + - v1.5.12 - Send click message to websocket on marker click - Issue #56 + - v1.5.11 - Let search also try geocoding lookup if not found in marks. - v1.5.10 - Allow latest mark added to open popup, and allow `popped=false` to close. - v1.5.7 - Tidy up sidc entry, and drag-ability of nodes on drawing layer. - v1.5.6 - Add search command and clear search functionality. diff --git a/README.md b/README.md index 209e5aa..81545e6 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ map web page for plotting "things" on. ### Updates -- v1.5.11 - Let search also try geocoding lookup if not marks found. +- v1.5.12 - Send click message to websocket on marker click - Issue #56 +- v1.5.11 - Let search also try geocoding lookup if not found in marks. - v1.5.10 - Allow latest mark added to open popup, and allow `popped=false` to close. - v1.5.7 - Tidy up sidc entry, and drag-ability of nodes on drawing layer. - v1.5.6 - Add search command and clear search functionality. @@ -19,14 +20,7 @@ map web page for plotting "things" on. - v1.5.2 - Make manually added icons moveable by default. - v1.5.0 - Add multi-map capability - can now have multiple map endpoints. - Also add built-in world countries overlay layer for offline use. -- v1.4.6 - allow more variation in fa-icon modifiers, so fa-3x and fa-spin work. -- v1.4.5 - fix clearing overlays -- v1.4.4 - add a couple of extra overlay layers, roads, rail, sea -- v1.4.3 - support custom icon for GPX and KML. Better readme for geojson. -- v1.4.2 - add NVG layer capability -- v1.4.1 - let `msg.payload.popup` set the popup contents. -- v1.4.0 - only send to specific \_sessionid if specified. -- ... + - ... see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list. diff --git a/package.json b/package.json index 511cdd3..2cf54d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-web-worldmap", - "version": "1.5.11", + "version": "1.5.12", "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 c47315d..01b97e6 100644 --- a/worldmap.html +++ b/worldmap.html @@ -190,7 +190,7 @@ then by default ⌘⇧m - ctrl-shift-m will load the m outputs:1, icon: "white-globe.png", label: function() { - return this.name||"world map"; + return this.name||this.path.substr(1)||"world map"; }, labelStyle: function() { return this.name?"node_label_italic":""; diff --git a/worldmap/index.html b/worldmap/index.html index bcd6ed6..ee0984b 100644 --- a/worldmap/index.html +++ b/worldmap/index.html @@ -1272,6 +1272,9 @@ function setMarker(data) { rightmenuMarker.setLatLng(e.latlng); map.openPopup(rightmenuMarker); }); + marker.on('click', function(e) { + ws.send(JSON.stringify({action:"click",name:marker.name,layer:marker.lay,icon:marker.icon,iconColor:marker.iconColor,SIDC:marker.SIDC,draggable:true,lat:parseFloat(marker.getLatLng().lat.toFixed(6)),lon:parseFloat(marker.getLatLng().lng.toFixed(6))})); + }); if ((data.addtoheatmap !== "false") || (!data.hasOwnProperty("addtoheatmap"))) { // Added to give ability to control if points from active layer contribute to heatmap if (heatAll || map.hasLayer(layers[lay])) { heat.addLatLng(lli); } } diff --git a/worldmap/worldmap.appcache b/worldmap/worldmap.appcache index 36f3860..7e4ac08 100644 --- a/worldmap/worldmap.appcache +++ b/worldmap/worldmap.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# date: Nov 9th 2018 - v1.5.11 +# date: Nov 9th 2018 - v1.5.12 CACHE: index.html