From eb012fee7aea47ed8e56a7a58048bce58a1eb4d3 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Mon, 27 Nov 2023 17:26:37 +0000 Subject: [PATCH] add quad(copter) drone icon bump to 4.4.0 --- CHANGELOG.md | 1 + README.md | 4 +++- package.json | 2 +- worldmap/worldmap.js | 21 +++++++++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0b52ca..0e6b769 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### Change Log for Node-RED Worldmap + - v4.4.0 - Add quad(copter) drone icon. - v4.3.3 - Fix for objects changing layers. - v4.3.2 - Fix geojson popup missing label name. - v4.3.1 - Small fix to icon transparency, and routing detail. diff --git a/README.md b/README.md index ac0592f..25bb5f6 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Feel free to [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D% ### Updates +- v4.4.0 - Add quad(copter) drone icon. - v4.3.3 - Fix for objects changing layers. - v4.3.2 - Fix geojson popup missing label name. - v4.3.1 - Small fix to icon transparency, and routing detail. @@ -106,7 +107,8 @@ There are also several special icons... - **ship** : a ship icon that aligns with the heading of travel. - **car** : a car icon that aligns with the heading of travel. - **bus** : a bus/coach icon that aligns with the heading of travel. - - **uav** : a small uav like icon that aligns with the heading of travel. + - **uav** : a small drone uav like icon that aligns with the heading of travel. + - **quad** : a small quadcopter uav like icon that aligns with the heading of travel. - **helicopter** : a small helicopter icon that aligns with the heading of travel. - **sensor** : a camera icon that points to the heading angle. - **arrow** : a map GPS arrow type pointer that aligns with the heading of travel. diff --git a/package.json b/package.json index 2abf86f..69c565f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-web-worldmap", - "version": "4.3.3", + "version": "4.4.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", diff --git a/worldmap/worldmap.js b/worldmap/worldmap.js index fcfb12a..66a106f 100644 --- a/worldmap/worldmap.js +++ b/worldmap/worldmap.js @@ -1845,6 +1845,18 @@ function setMarker(data) { }); marker = L.marker(ll, {title:data["name"], icon:myMarker, draggable:drag}); } + else if (data.icon === "quad") { + data.iconColor = data.iconColor || "black"; + icon = ''; + icon+= ''; + var svgquad = "data:image/svg+xml;base64," + btoa(icon); + myMarker = L.divIcon({ + className:"quadicon", + iconAnchor: [16, 16], + html:'', + }); + marker = L.marker(ll, {title:data["name"], icon:myMarker, draggable:drag}); + } else if (data.icon === "car") { data.iconColor = data.iconColor || "black"; icon = ''; @@ -2262,6 +2274,15 @@ function setMarker(data) { marker.bindPopup(words, wopt); marker._popup.dname = data["name"]; } + + if (data.hasOwnProperty("clickURL")) { + marker.on('click', function () { + console.log("Click URL - ",data.clickURL) + window.open(data.clickURL.replace('@',''), 'newwindow', 'width=640, height=480'); + return false; + }); + } + marker.lay = lay; // and the layer it is on // marker.on('click', function(e) {