node-red-contrib-web-worldmap 5.0.7 → 5.0.9
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.
- package/.github/dependabot.yml +11 -0
- package/CHANGELOG.md +4 -1
- package/README.md +33 -27
- package/examples/SIDC icons with flags.json +1 -0
- package/node_modules/@turf/bezier-spline/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/bezier-spline/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/bezier-spline/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/bezier-spline/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/bezier-spline/package.json +10 -10
- package/node_modules/@turf/helpers/README.md +199 -154
- package/node_modules/@turf/helpers/dist/cjs/index.cjs +10 -7
- package/node_modules/@turf/helpers/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/helpers/dist/cjs/index.d.cts +149 -110
- package/node_modules/@turf/helpers/dist/esm/index.d.ts +149 -110
- package/node_modules/@turf/helpers/dist/esm/index.js +10 -7
- package/node_modules/@turf/helpers/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/helpers/package.json +8 -8
- package/node_modules/@turf/invariant/README.md +4 -0
- package/node_modules/@turf/invariant/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/invariant/dist/cjs/index.d.cts +6 -6
- package/node_modules/@turf/invariant/dist/esm/index.d.ts +6 -6
- package/node_modules/@turf/invariant/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/invariant/package.json +9 -9
- package/node_modules/@types/geojson/README.md +1 -1
- package/node_modules/@types/geojson/index.d.ts +4 -1
- package/node_modules/@types/geojson/package.json +4 -3
- package/node_modules/express/History.md +10 -1
- package/node_modules/express/package.json +6 -2
- package/node_modules/path-to-regexp/index.js +13 -3
- package/node_modules/path-to-regexp/package.json +1 -1
- package/package.json +3 -3
- package/worldmap/index.html +2 -2
- package/worldmap/leaflet/leaflet-side-by-side.js +148 -147
- package/worldmap/worldmap.js +83 -64
- package/worldmap.js +8 -7
- package/worldmap/leaflet/dialog-polyfill.css +0 -37
- package/worldmap/leaflet/dialog-polyfill.js +0 -736
- /package/examples/{sidcEdgeIcon.json → sidcEdgeIcon control.json} +0 -0
package/worldmap/index.html
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<link rel="stylesheet" type="text/css" href="leaflet/Control.MiniMap.min.css">
|
|
41
41
|
<link rel="stylesheet" type="text/css" href="leaflet/leaflet-velocity.min.css">
|
|
42
42
|
<link rel="stylesheet" type="text/css" href="leaflet/leaflet.mousecoordinate.css">
|
|
43
|
-
<link rel="stylesheet" type="text/css" href="leaflet/dialog-polyfill.css"/>
|
|
43
|
+
<!-- <link rel="stylesheet" type="text/css" href="leaflet/dialog-polyfill.css"/> -->
|
|
44
44
|
<link rel="stylesheet" type="text/css" href="css/worldmap.css"/>
|
|
45
45
|
|
|
46
46
|
<script src="leaflet/sockjs.min.js"></script>
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
<script src="leaflet/leaflet.antimeridian-src.js"></script>
|
|
83
83
|
<script src="leaflet/L.TileLayer.PixelFilter.js"></script>
|
|
84
84
|
<script src="leaflet/jszip.min.js"></script>
|
|
85
|
-
<script src="leaflet/dialog-polyfill.js"></script>
|
|
85
|
+
<!-- <script src="leaflet/dialog-polyfill.js"></script> -->
|
|
86
86
|
<script src="images/emoji.js"></script>
|
|
87
87
|
</head>
|
|
88
88
|
|
|
@@ -50,161 +50,162 @@
|
|
|
50
50
|
|
|
51
51
|
function noop() { }
|
|
52
52
|
|
|
53
|
-
L
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
setSplit: function (s) {
|
|
95
|
-
this._range.value = s / 100;
|
|
96
|
-
this._updateClip();
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
remove: function () {
|
|
100
|
-
if (!this._map) {
|
|
53
|
+
if (L) {
|
|
54
|
+
L.Control.SideBySide = L.Control.extend({
|
|
55
|
+
options: {
|
|
56
|
+
thumbSize: 42,
|
|
57
|
+
padding: 0
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
initialize: function (leftLayers, rightLayers, options) {
|
|
61
|
+
this.setLeftLayers(leftLayers)
|
|
62
|
+
this.setRightLayers(rightLayers)
|
|
63
|
+
L.setOptions(this, options)
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
getPosition: function () {
|
|
67
|
+
var rangeValue = this._range.value
|
|
68
|
+
var offset = (0.5 - rangeValue) * (2 * this.options.padding + this.options.thumbSize)
|
|
69
|
+
return this._map.getSize().x * rangeValue + offset
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
setPosition: noop,
|
|
73
|
+
|
|
74
|
+
includes: L.Evented.prototype || L.Mixin.Events,
|
|
75
|
+
|
|
76
|
+
addTo: function (map) {
|
|
77
|
+
this.remove()
|
|
78
|
+
this._map = map
|
|
79
|
+
|
|
80
|
+
var container = this._container = L.DomUtil.create('div', 'leaflet-sbs', map._controlContainer)
|
|
81
|
+
|
|
82
|
+
this._divider = L.DomUtil.create('div', 'leaflet-sbs-divider', container)
|
|
83
|
+
var range = this._range = L.DomUtil.create('input', 'leaflet-sbs-range', container)
|
|
84
|
+
range.type = 'range'
|
|
85
|
+
range.min = 0
|
|
86
|
+
range.max = 1
|
|
87
|
+
range.step = 'any'
|
|
88
|
+
range.value = 0.5
|
|
89
|
+
range.style.paddingLeft = range.style.paddingRight = this.options.padding + 'px'
|
|
90
|
+
this._addEvents()
|
|
91
|
+
this._updateLayers()
|
|
101
92
|
return this
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
setRightLayers: function (rightLayers) {
|
|
124
|
-
this._rightLayers = asArray(rightLayers)
|
|
125
|
-
this._updateLayers()
|
|
126
|
-
return this
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
_updateClip: function () {
|
|
130
|
-
var map = this._map
|
|
131
|
-
var nw = map.containerPointToLayerPoint([0, 0])
|
|
132
|
-
var se = map.containerPointToLayerPoint(map.getSize())
|
|
133
|
-
se.y += 40;
|
|
134
|
-
var clipX = nw.x + this.getPosition()
|
|
135
|
-
var dividerX = this.getPosition()
|
|
136
|
-
|
|
137
|
-
this._divider.style.left = dividerX + 'px'
|
|
138
|
-
this.fire('dividermove', { x: dividerX })
|
|
139
|
-
var clipLeft = 'rect(' + [nw.y, clipX, se.y, nw.x].join('px,') + 'px)'
|
|
140
|
-
var clipRight = 'rect(' + [nw.y, se.x, se.y, clipX].join('px,') + 'px)'
|
|
141
|
-
if (this._leftLayer) {
|
|
142
|
-
this._leftLayer.getContainer().style.clip = clipLeft
|
|
143
|
-
}
|
|
144
|
-
if (this._rightLayer) {
|
|
145
|
-
this._rightLayer.getContainer().style.clip = clipRight
|
|
146
|
-
}
|
|
147
|
-
},
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
setSplit: function (s) {
|
|
96
|
+
this._range.value = s / 100;
|
|
97
|
+
this._updateClip();
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
remove: function () {
|
|
101
|
+
if (!this._map) {
|
|
102
|
+
return this
|
|
103
|
+
}
|
|
104
|
+
if (this._leftLayer) {
|
|
105
|
+
this._leftLayer.getContainer().style.clip = ''
|
|
106
|
+
}
|
|
107
|
+
if (this._rightLayer) {
|
|
108
|
+
this._rightLayer.getContainer().style.clip = ''
|
|
109
|
+
}
|
|
110
|
+
this._removeEvents()
|
|
111
|
+
L.DomUtil.remove(this._container)
|
|
112
|
+
|
|
113
|
+
this._map = null
|
|
148
114
|
|
|
149
|
-
_updateLayers: function () {
|
|
150
|
-
if (!this._map) {
|
|
151
115
|
return this
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
setLeftLayers: function (leftLayers) {
|
|
119
|
+
this._leftLayers = asArray(leftLayers)
|
|
120
|
+
this._updateLayers()
|
|
121
|
+
return this
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
setRightLayers: function (rightLayers) {
|
|
125
|
+
this._rightLayers = asArray(rightLayers)
|
|
126
|
+
this._updateLayers()
|
|
127
|
+
return this
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
_updateClip: function () {
|
|
131
|
+
var map = this._map
|
|
132
|
+
var nw = map.containerPointToLayerPoint([0, 0])
|
|
133
|
+
var se = map.containerPointToLayerPoint(map.getSize())
|
|
134
|
+
se.y += 40;
|
|
135
|
+
var clipX = nw.x + this.getPosition()
|
|
136
|
+
var dividerX = this.getPosition()
|
|
137
|
+
|
|
138
|
+
this._divider.style.left = dividerX + 'px'
|
|
139
|
+
this.fire('dividermove', { x: dividerX })
|
|
140
|
+
var clipLeft = 'rect(' + [nw.y, clipX, se.y, nw.x].join('px,') + 'px)'
|
|
141
|
+
var clipRight = 'rect(' + [nw.y, se.x, se.y, clipX].join('px,') + 'px)'
|
|
142
|
+
if (this._leftLayer) {
|
|
143
|
+
this._leftLayer.getContainer().style.clip = clipLeft
|
|
159
144
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (this._map.hasLayer(layer)) {
|
|
163
|
-
this._rightLayer = layer
|
|
145
|
+
if (this._rightLayer) {
|
|
146
|
+
this._rightLayer.getContainer().style.clip = clipRight
|
|
164
147
|
}
|
|
165
|
-
},
|
|
166
|
-
if (prevLeft !== this._leftLayer) {
|
|
167
|
-
prevLeft && this.fire('leftlayerremove', { layer: prevLeft })
|
|
168
|
-
this._leftLayer && this.fire('leftlayeradd', { layer: this._leftLayer })
|
|
169
|
-
}
|
|
170
|
-
if (prevRight !== this._rightLayer) {
|
|
171
|
-
prevRight && this.fire('rightlayerremove', { layer: prevRight })
|
|
172
|
-
this._rightLayer && this.fire('rightlayeradd', { layer: this._rightLayer })
|
|
173
|
-
}
|
|
174
|
-
this._updateClip()
|
|
175
|
-
},
|
|
176
|
-
|
|
177
|
-
_addEvents: function () {
|
|
178
|
-
var range = this._range
|
|
179
|
-
var map = this._map
|
|
180
|
-
if (!map || !range) return
|
|
181
|
-
map.on('move', this._updateClip, this)
|
|
182
|
-
map.on('layeradd layerremove', this._updateLayers, this)
|
|
183
|
-
on(range, getRangeEvent(range), this._updateClip, this)
|
|
184
|
-
on(range, L.Browser.touch ? 'touchstart' : 'mousedown', cancelMapDrag, this)
|
|
185
|
-
on(range, L.Browser.touch ? 'touchend' : 'mouseup', uncancelMapDrag, this)
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
_removeEvents: function () {
|
|
189
|
-
var range = this._range
|
|
190
|
-
var map = this._map
|
|
191
|
-
if (range) {
|
|
192
|
-
off(range, getRangeEvent(range), this._updateClip, this)
|
|
193
|
-
off(range, L.Browser.touch ? 'touchstart' : 'mousedown', cancelMapDrag, this)
|
|
194
|
-
off(range, L.Browser.touch ? 'touchend' : 'mouseup', uncancelMapDrag, this)
|
|
195
|
-
}
|
|
196
|
-
if (map) {
|
|
197
|
-
map.off('layeradd layerremove', this._updateLayers, this)
|
|
198
|
-
map.off('move', this._updateClip, this)
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
})
|
|
148
|
+
},
|
|
202
149
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
150
|
+
_updateLayers: function () {
|
|
151
|
+
if (!this._map) {
|
|
152
|
+
return this
|
|
153
|
+
}
|
|
154
|
+
var prevLeft = this._leftLayer
|
|
155
|
+
var prevRight = this._rightLayer
|
|
156
|
+
this._leftLayer = this._rightLayer = null
|
|
157
|
+
this._leftLayers.forEach(function (layer) {
|
|
158
|
+
if (this._map.hasLayer(layer)) {
|
|
159
|
+
this._leftLayer = layer
|
|
160
|
+
}
|
|
161
|
+
}, this)
|
|
162
|
+
this._rightLayers.forEach(function (layer) {
|
|
163
|
+
if (this._map.hasLayer(layer)) {
|
|
164
|
+
this._rightLayer = layer
|
|
165
|
+
}
|
|
166
|
+
}, this)
|
|
167
|
+
if (prevLeft !== this._leftLayer) {
|
|
168
|
+
prevLeft && this.fire('leftlayerremove', { layer: prevLeft })
|
|
169
|
+
this._leftLayer && this.fire('leftlayeradd', { layer: this._leftLayer })
|
|
170
|
+
}
|
|
171
|
+
if (prevRight !== this._rightLayer) {
|
|
172
|
+
prevRight && this.fire('rightlayerremove', { layer: prevRight })
|
|
173
|
+
this._rightLayer && this.fire('rightlayeradd', { layer: this._rightLayer })
|
|
174
|
+
}
|
|
175
|
+
this._updateClip()
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
_addEvents: function () {
|
|
179
|
+
var range = this._range
|
|
180
|
+
var map = this._map
|
|
181
|
+
if (!map || !range) return
|
|
182
|
+
map.on('move', this._updateClip, this)
|
|
183
|
+
map.on('layeradd layerremove', this._updateLayers, this)
|
|
184
|
+
on(range, getRangeEvent(range), this._updateClip, this)
|
|
185
|
+
on(range, L.Browser.touch ? 'touchstart' : 'mousedown', cancelMapDrag, this)
|
|
186
|
+
on(range, L.Browser.touch ? 'touchend' : 'mouseup', uncancelMapDrag, this)
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
_removeEvents: function () {
|
|
190
|
+
var range = this._range
|
|
191
|
+
var map = this._map
|
|
192
|
+
if (range) {
|
|
193
|
+
off(range, getRangeEvent(range), this._updateClip, this)
|
|
194
|
+
off(range, L.Browser.touch ? 'touchstart' : 'mousedown', cancelMapDrag, this)
|
|
195
|
+
off(range, L.Browser.touch ? 'touchend' : 'mouseup', uncancelMapDrag, this)
|
|
196
|
+
}
|
|
197
|
+
if (map) {
|
|
198
|
+
map.off('layeradd layerremove', this._updateLayers, this)
|
|
199
|
+
map.off('move', this._updateClip, this)
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
})
|
|
206
203
|
|
|
204
|
+
L.control.sideBySide = function (leftLayers, rightLayers, options) {
|
|
205
|
+
return new L.Control.SideBySide(leftLayers, rightLayers, options)
|
|
206
|
+
}
|
|
207
207
|
module.exports = L.Control.SideBySide
|
|
208
|
+
}
|
|
208
209
|
|
|
209
210
|
}).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
210
211
|
}, { "./layout.css": 2, "./range.css": 4 }], 2: [function (require, module, exports) {
|