node-red-contrib-web-worldmap 2.28.0 → 2.28.1

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,70 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ master ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ master ]
20
+ schedule:
21
+ - cron: '39 16 * * 6'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'javascript' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://git.io/codeql-language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v3
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v2
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
52
+
53
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54
+ # If this step fails, then you should remove it and run the build manually (see below)
55
+ - name: Autobuild
56
+ uses: github/codeql-action/autobuild@v2
57
+
58
+ # ℹ️ Command-line programs to run using the OS shell.
59
+ # 📚 https://git.io/JvXDl
60
+
61
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62
+ # and modify them (or add more) to build your code if your project
63
+ # uses a compiled language
64
+
65
+ #- run: |
66
+ # make bootstrap
67
+ # make release
68
+
69
+ - name: Perform CodeQL Analysis
70
+ uses: github/codeql-action/analyze@v2
package/CHANGELOG.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
- - v2.27.4 - Better Handling of sidc icons in geojson
3
+ - v2.28.1 - Fix layer command bug for non-core layers. Issue #195
4
+ - v2.28.0 - Better Handling of sidc icons in geojson
4
5
  - v2.27.3 - Try to handle greatcircles crossing antimeridian
5
6
  - v2.27.1 - Reload existing markers for late joiners
6
7
  - v2.26.1 - Add QTH/Maidenhead option also
package/README.md CHANGED
@@ -11,7 +11,8 @@ map web page for plotting "things" on.
11
11
 
12
12
  ### Updates
13
13
 
14
- - v2.27.4 - Better Handling of sidc icons in geojson
14
+ - v2.28.1 - Fix layer command bug for non-core layers. Issue #195
15
+ - v2.28.0 - Better Handling of sidc icons in geojson
15
16
  - v2.27.3 - Try to handle greatcircles crossing antimeridian
16
17
  - v2.27.1 - Reload existing markers for late joiners
17
18
  - v2.26.1 - Add QTH/Maidenhead option also
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "2.28.0",
3
+ "version": "2.28.1",
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",
@@ -733,16 +733,21 @@ map.on('contextmenu', function(e) {
733
733
  }
734
734
  });
735
735
 
736
+
737
+ // Layer control based on select box rather than radio buttons.
738
+ //var layercontrol = L.control.selectLayers(basemaps, overlays).addTo(map);
739
+ layercontrol = L.control.layers(basemaps, overlays);
740
+
736
741
  // Add all the base layer maps if we are online.
737
742
  var addBaseMaps = function(maplist,first) {
738
743
  // console.log("MAPS",first,maplist)
739
- if (navigator.onLine) {
740
- var layerlookup = { OSMG:"OSM grey", OSMC:"OSM", OSMH:"OSM Humanitarian", EsriC:"Esri", EsriS:"Esri Satellite",
741
- EsriR:"Esri Relief", EsriT:"Esri Topography", EsriO:"Esri Ocean", EsriDG:"Esri Dark Grey", NatGeo: "National Geographic",
742
- UKOS:"UK OS OpenData", OS45:"UK OS 1919-1947", OS00:"UK OS 1900", OpTop:"Open Topo Map",
743
- HB:"Hike Bike OSM", ST:"Stamen Topography", SW:"Stamen Watercolor", AN:"AutoNavi (Chinese)"
744
- }
744
+ var layerlookup = { OSMG:"OSM grey", OSMC:"OSM", OSMH:"OSM Humanitarian", EsriC:"Esri", EsriS:"Esri Satellite",
745
+ EsriR:"Esri Relief", EsriT:"Esri Topography", EsriO:"Esri Ocean", EsriDG:"Esri Dark Grey", NatGeo: "National Geographic",
746
+ UKOS:"UK OS OpenData", OS45:"UK OS 1919-1947", OS00:"UK OS 1900", OpTop:"Open Topo Map",
747
+ HB:"Hike Bike OSM", ST:"Stamen Topography", SW:"Stamen Watercolor", AN:"AutoNavi (Chinese)"
748
+ }
745
749
 
750
+ if (navigator.onLine) {
746
751
  // Use this for OSM online maps
747
752
  var osmUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
748
753
  var osmAttrib='Map data © OpenStreetMap contributors';
@@ -903,18 +908,19 @@ var addBaseMaps = function(maplist,first) {
903
908
  attribution: 'Map tiles by <a href="https://stamen.com">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="https://openstreetmap.org">OpenStreetMap</a>, under <a href="https://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>'
904
909
  });
905
910
  }
911
+ }
906
912
 
907
- if (first) {
908
- if (layerlookup[first]) { basemaps[layerlookup[first]].addTo(map); }
909
- else { basemaps[first].addTo(map); }
910
- }
911
- else {
912
- basemaps[Object.keys(basemaps)[0]].addTo(map);
913
- }
914
- if (showLayerMenu) {
915
- map.removeControl(layercontrol);
916
- layercontrol = L.control.layers(basemaps, overlays).addTo(map);
917
- }
913
+ if (first) {
914
+ if (layerlookup[first]) { baselayername = layerlookup[first]; }
915
+ else { basenayername = first; }
916
+ }
917
+ else {
918
+ basenayername = Object.keys(basemaps)[0];
919
+ }
920
+ basemaps[baselayername].addTo(map);
921
+ if (showLayerMenu) {
922
+ map.removeControl(layercontrol);
923
+ layercontrol = L.control.layers(basemaps, overlays).addTo(map);
918
924
  }
919
925
  }
920
926
 
@@ -960,7 +966,7 @@ var addOverlays = function(overlist) {
960
966
  });
961
967
  var changeDrawColour = function(col) {
962
968
  drawingColour = col;
963
- console.log("COLOR",col)
969
+ // console.log("COLOR",col)
964
970
  drawControl.setDrawingOptions({
965
971
  polyline: { shapeOptions: { color:drawingColour } },
966
972
  circle: { shapeOptions: { color:drawingColour } },
@@ -1111,7 +1117,7 @@ var addOverlays = function(overlist) {
1111
1117
  }
1112
1118
 
1113
1119
  // Add the countries (world-110m) for offline use
1114
- if (overlist.indexOf("CO")!==-1 || (!navigator.onLine)) {
1120
+ if (overlist.indexOf("CO") !== -1 || !navigator.onLine) {
1115
1121
  var customTopoLayer = L.geoJson(null, {clickable:false, style: {color:"blue", weight:2, fillColor:"#cf6", fillOpacity:0.04}});
1116
1122
  layers["_countries"] = omnivore.topojson('images/world-50m-flat.json',null,customTopoLayer);
1117
1123
  overlays["countries"] = layers["_countries"];
@@ -1196,10 +1202,6 @@ var addOverlays = function(overlist) {
1196
1202
  }
1197
1203
  }
1198
1204
 
1199
- // Layer control based on select box rather than radio buttons.
1200
- //var layercontrol = L.control.selectLayers(basemaps, overlays).addTo(map);
1201
- layercontrol = L.control.layers(basemaps, overlays);
1202
-
1203
1205
  // Add the layers control widget
1204
1206
  if (!inIframe) { layercontrol.addTo(map); }
1205
1207
  else { showLayerMenu = false;}
@@ -2224,7 +2226,7 @@ function doCommand(cmd) {
2224
2226
  var existsalready = false;
2225
2227
  // Add a new base map layer
2226
2228
  if (cmd.map && cmd.map.hasOwnProperty("name") && cmd.map.name.length>0 && cmd.map.hasOwnProperty("url") && cmd.map.hasOwnProperty("opt")) {
2227
- console.log("BASE",cmd.map);
2229
+ // console.log("BASE",cmd.map);
2228
2230
  if (basemaps.hasOwnProperty(cmd.map.name)) { existsalready = true; }
2229
2231
  if (cmd.map.hasOwnProperty("wms")) { // special case for wms
2230
2232
  console.log("New WMS:",cmd.map.name);
@@ -2523,6 +2525,7 @@ function doCommand(cmd) {
2523
2525
  baselayername = cmd.layer;
2524
2526
  basemaps[baselayername].addTo(map);
2525
2527
  }
2528
+ // If set to none then remove the baselayer...
2526
2529
  if (cmd.layer && (cmd.layer === "none")) {
2527
2530
  map.removeLayer(basemaps[baselayername]);
2528
2531
  baselayername = cmd.layer;