node-red-contrib-web-worldmap 4.3.3 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,50 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # ESLint is a tool for identifying and reporting on patterns
6
+ # found in ECMAScript/JavaScript code.
7
+ # More details at https://github.com/eslint/eslint
8
+ # and https://eslint.org
9
+
10
+ name: ESLint
11
+
12
+ on:
13
+ push:
14
+ branches: [ "master" ]
15
+ pull_request:
16
+ # The branches below must be a subset of the branches above
17
+ branches: [ "master" ]
18
+ schedule:
19
+ - cron: '38 2 * * 4'
20
+
21
+ jobs:
22
+ eslint:
23
+ name: Run eslint scanning
24
+ runs-on: ubuntu-latest
25
+ permissions:
26
+ contents: read
27
+ security-events: write
28
+ actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
29
+ steps:
30
+ - name: Checkout code
31
+ uses: actions/checkout@v3
32
+
33
+ - name: Install ESLint
34
+ run: |
35
+ npm install eslint@8.10.0
36
+ npm install @microsoft/eslint-formatter-sarif@2.1.7
37
+
38
+ - name: Run ESLint
39
+ run: npx eslint .
40
+ --config .eslintrc.js
41
+ --ext .js,.jsx,.ts,.tsx
42
+ --format @microsoft/eslint-formatter-sarif
43
+ --output-file eslint-results.sarif
44
+ continue-on-error: true
45
+
46
+ - name: Upload analysis results to GitHub
47
+ uses: github/codeql-action/upload-sarif@v2
48
+ with:
49
+ sarif_file: eslint-results.sarif
50
+ wait-for-processing: true
package/CHANGELOG.md CHANGED
@@ -1,5 +1,6 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
+ - v4.4.0 - Add quad(copter) drone icon.
3
4
  - v4.3.3 - Fix for objects changing layers.
4
5
  - v4.3.2 - Fix geojson popup missing label name.
5
6
  - v4.3.1 - Small fix to icon transparency, and routing detail.
package/README.md CHANGED
@@ -13,6 +13,7 @@ Feel free to [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%
13
13
 
14
14
  ### Updates
15
15
 
16
+ - v4.4.0 - Add quad(copter) drone icon.
16
17
  - v4.3.3 - Fix for objects changing layers.
17
18
  - v4.3.2 - Fix geojson popup missing label name.
18
19
  - v4.3.1 - Small fix to icon transparency, and routing detail.
@@ -106,7 +107,8 @@ There are also several special icons...
106
107
  - **ship** : a ship icon that aligns with the heading of travel.
107
108
  - **car** : a car icon that aligns with the heading of travel.
108
109
  - **bus** : a bus/coach icon that aligns with the heading of travel.
109
- - **uav** : a small uav like icon that aligns with the heading of travel.
110
+ - **uav** : a small drone uav like icon that aligns with the heading of travel.
111
+ - **quad** : a small quadcopter uav like icon that aligns with the heading of travel.
110
112
  - **helicopter** : a small helicopter icon that aligns with the heading of travel.
111
113
  - **sensor** : a camera icon that points to the heading angle.
112
114
  - **arrow** : a map GPS arrow type pointer that aligns with the heading of travel.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "4.3.3",
3
+ "version": "4.4.0",
4
4
  "description": "A Node-RED node to provide a web page of a world map for plotting things on.",
5
5
  "dependencies": {
6
6
  "@turf/bezier-spline": "~6.5.0",
@@ -1845,6 +1845,18 @@ function setMarker(data) {
1845
1845
  });
1846
1846
  marker = L.marker(ll, {title:data["name"], icon:myMarker, draggable:drag});
1847
1847
  }
1848
+ else if (data.icon === "quad") {
1849
+ data.iconColor = data.iconColor || "black";
1850
+ icon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 22 22">';
1851
+ icon+= '<path d="m6 3a3 3 0 0 0 -3 3 3 3 0 0 0 3 3 3 3 0 0 0 1.0859375-.2070312c.5392711.8209481.9140625 1.6424172.9140625 2.2070312 0 .563623-.3724493 1.384498-.9101562 2.205078a3 3 0 0 0 -1.0898438-.205078 3 3 0 0 0 -3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0 -.2050781-1.080078c.8233483-.542436 1.6446221-.919922 2.2050781-.919922.55949 0 1.37815.375313 2.201172.916016a3 3 0 0 0 -.201172 1.083984 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0 -3-3 3 3 0 0 0 -1.085938.207031c-.539273-.820943-.914062-1.642417-.914062-2.207031 0-.563623.372445-1.3844956.910156-2.2050781a3 3 0 0 0 .002.00195 3 3 0 0 0 1.087844.2031281 3 3 0 0 0 3-3 3 3 0 0 0 -3-3 3 3 0 0 0 -3 3 3 3 0 0 0 .205078 1.0800781c-.823351.5424443-1.644622.9199219-2.205078.9199219-.55949 0-1.3781473-.3753084-2.2011719-.9160156a3 3 0 0 0 .2011719-1.0839844 3 3 0 0 0 -3-3zm0 1a2 2 0 0 1 2 2 2 2 0 0 1 -.0527344.453125c-.4577913-.368834-.8926099-.7589139-1.2402344-1.1601562a1 1 0 0 0 -.6933593-.2929688 1 1 0 0 0 -.7207031.2929688 1 1 0 0 0 0 1.4140624 1 1 0 0 0 .058594.054688c.3824613.333788.7551689.7476371 1.1074216 1.1835933a2 2 0 0 1 -.4589844.0546875 2 2 0 0 1 -2-2 2 2 0 0 1 2-2zm10 0a2 2 0 0 1 2 2 2 2 0 0 1 -2 2 2 2 0 0 1 -.457031-.054687c.37051-.4592027.761959-.8951713 1.164062-1.2382813a1 1 0 0 0 0-1.4140624 1 1 0 0 0 -1.414062 0 1 1 0 0 0 -.05274.054687c-.337606.3818392-.750702.7543351-1.185541 1.1054687a2 2 0 0 1 -.054688-.453125 2 2 0 0 1 2-2zm-10 10a2 2 0 0 1 .4570312.05469c-.3705108.459203-.7619484.895165-1.1640624 1.238281a1 1 0 0 0 0 1.414062 1 1 0 0 0 1.4140624 0 1 1 0 0 0 .052734-.05469c.3376223-.381857.7507063-.754333 1.1855473-1.105468a2 2 0 0 1 .0546875.453125 2 2 0 0 1 -2 2 2 2 0 0 1 -2-2 2 2 0 0 1 2-2zm10 0a2 2 0 0 1 2 2 2 2 0 0 1 -2 2 2 2 0 0 1 -2-2 2 2 0 0 1 .05273-.453125c.457792.368835.892604.758903 1.240235 1.160156a1 1 0 0 0 1.414062 0 1 1 0 0 0 0-1.414062c-.01717-.01465-.0336-.03387-.05078-.04883a1 1 0 0 0 -.0078-.0059c-.382475-.333732-.755177-.747602-1.107431-1.183551a2 2 0 0 1 .458984-.054688z" fill="'+data.iconColor+'"/></svg>';
1852
+ var svgquad = "data:image/svg+xml;base64," + btoa(icon);
1853
+ myMarker = L.divIcon({
1854
+ className:"quadicon",
1855
+ iconAnchor: [16, 16],
1856
+ html:'<img src="'+svgquad+'" style="width:32px; height:32px; -webkit-transform:rotate('+dir+'deg); -moz-transform:rotate('+dir+'deg);"/>',
1857
+ });
1858
+ marker = L.marker(ll, {title:data["name"], icon:myMarker, draggable:drag});
1859
+ }
1848
1860
  else if (data.icon === "car") {
1849
1861
  data.iconColor = data.iconColor || "black";
1850
1862
  icon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="47px" height="47px" viewBox="0 0 47 47">';
@@ -2262,6 +2274,15 @@ function setMarker(data) {
2262
2274
  marker.bindPopup(words, wopt);
2263
2275
  marker._popup.dname = data["name"];
2264
2276
  }
2277
+
2278
+ if (data.hasOwnProperty("clickURL")) {
2279
+ marker.on('click', function () {
2280
+ console.log("Click URL - ",data.clickURL)
2281
+ window.open(data.clickURL.replace('@',''), 'newwindow', 'width=640, height=480');
2282
+ return false;
2283
+ });
2284
+ }
2285
+
2265
2286
  marker.lay = lay; // and the layer it is on
2266
2287
 
2267
2288
  // marker.on('click', function(e) {