node-red-contrib-web-worldmap 2.32.0 → 2.32.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
+ - v2.32.3 - Fix map split in iframe position
4
+ - v2.32.1 - Let command.heatmap replace complete heatmap array.
3
5
  - v2.32.0 - Change || to nullish operator ?? to fix numerous dodgy assignments. Issue #219
4
6
  Delete marker now also removes from heatmap layer. Issue #218
5
7
 
package/README.md CHANGED
@@ -11,6 +11,8 @@ map web page for plotting "things" on.
11
11
 
12
12
  ### Updates
13
13
 
14
+ - v2.32.2 - Fix map split in iframe position
15
+ - v2.32.1 - Let command.map.heatmap replace complete heatmap array.
14
16
  - v2.32.0 - Change || to nullish operator ?? to fix numerous dodgy assignments. Issue #219
15
17
  Delete marker now also removes from heatmap layer. Issue #218
16
18
  - v2.31.3 - Undo previous fix as while more technically correct - doesn't look so good. Issue #217
@@ -410,7 +412,8 @@ Optional properties include
410
412
  - **wms** - true/false/grey, specifies if the data is provided by a Web Map Service (if grey sets layer to greyscale)
411
413
  - **bounds** - sets the bounds of an Overlay-Image. 2 Dimensional Array that defines the top-left and bottom-right Corners (lat/lon Points)
412
414
  - **delete** - name or array of names of base layers and/or overlays to delete and remove from layer menu.
413
- - **heatmap** - set heatmap options object see https://github.com/Leaflet/Leaflet.heat#reference
415
+ - **heatmap** - set heatmap latlngs array object see https://github.com/Leaflet/Leaflet.heat#reference
416
+ - **options** - if heatmap set, then use this to set heatmap options object see https://github.com/Leaflet/Leaflet.heat#reference
414
417
  - **clear** - layer name - to clear a complete layer and remove from layer menu - `{"command":{"clear":"myOldLayer"}}`
415
418
  - **panlock** - lock the map area to the current visible area. - `{"command":{"panlock":true}}`
416
419
  - **panit** - auto pan to the latest marker updated. - `{"command":{"panit":true}}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "2.32.0",
3
+ "version": "2.32.3",
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",
@@ -1,275 +1,278 @@
1
- (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2
- (function (global){
3
- var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null)
4
- require('./layout.css')
5
- require('./range.css')
6
-
7
- var mapWasDragEnabled
8
- var mapWasTapEnabled
9
-
10
- // Leaflet v0.7 backwards compatibility
11
- function on (el, types, fn, context) {
12
- types.split(' ').forEach(function (type) {
13
- L.DomEvent.on(el, type, fn, context)
14
- })
15
- }
16
-
17
- // Leaflet v0.7 backwards compatibility
18
- function off (el, types, fn, context) {
19
- types.split(' ').forEach(function (type) {
20
- L.DomEvent.off(el, type, fn, context)
21
- })
22
- }
23
-
24
- function getRangeEvent (rangeInput) {
25
- return 'oninput' in rangeInput ? 'input' : 'change'
26
- }
27
-
28
- function cancelMapDrag () {
29
- mapWasDragEnabled = this._map.dragging.enabled()
30
- mapWasTapEnabled = this._map.tap && this._map.tap.enabled()
31
- this._map.dragging.disable()
32
- this._map.tap && this._map.tap.disable()
33
- }
34
-
35
- function uncancelMapDrag (e) {
36
- this._refocusOnMap(e)
37
- if (mapWasDragEnabled) {
38
- this._map.dragging.enable()
39
- }
40
- if (mapWasTapEnabled) {
41
- this._map.tap.enable()
42
- }
43
- }
44
-
45
- // convert arg to an array - returns empty array if arg is undefined
46
- function asArray (arg) {
47
- return (arg === 'undefined') ? [] : Array.isArray(arg) ? arg : [arg]
48
- }
49
-
50
- function noop () {}
51
-
52
- L.Control.SideBySide = L.Control.extend({
53
- options: {
54
- thumbSize: 42,
55
- padding: 0
56
- },
57
-
58
- initialize: function (leftLayers, rightLayers, options) {
59
- this.setLeftLayers(leftLayers)
60
- this.setRightLayers(rightLayers)
61
- L.setOptions(this, options)
62
- },
63
-
64
- getPosition: function () {
65
- var rangeValue = this._range.value
66
- var offset = (0.5 - rangeValue) * (2 * this.options.padding + this.options.thumbSize)
67
- return this._map.getSize().x * rangeValue + offset
68
- },
69
-
70
- setPosition: noop,
71
-
72
- includes: L.Evented.prototype || L.Mixin.Events,
73
-
74
- addTo: function (map) {
75
- this.remove()
76
- this._map = map
77
-
78
- var container = this._container = L.DomUtil.create('div', 'leaflet-sbs', map._controlContainer)
79
-
80
- this._divider = L.DomUtil.create('div', 'leaflet-sbs-divider', container)
81
- var range = this._range = L.DomUtil.create('input', 'leaflet-sbs-range', container)
82
- range.type = 'range'
83
- range.min = 0
84
- range.max = 1
85
- range.step = 'any'
86
- range.value = 0.5
87
- range.style.paddingLeft = range.style.paddingRight = this.options.padding + 'px'
88
- this._addEvents()
89
- this._updateLayers()
90
- return this
91
- },
92
-
93
- setSplit: function(s) {
94
- this._range.value = s/100;
95
- this._updateClip();
96
- },
97
-
98
- remove: function () {
99
- if (!this._map) {
100
- return this
101
- }
102
- if (this._leftLayer) {
103
- this._leftLayer.getContainer().style.clip = ''
104
- }
105
- if (this._rightLayer) {
106
- this._rightLayer.getContainer().style.clip = ''
107
- }
108
- this._removeEvents()
109
- L.DomUtil.remove(this._container)
110
-
111
- this._map = null
112
-
113
- return this
114
- },
115
-
116
- setLeftLayers: function (leftLayers) {
117
- this._leftLayers = asArray(leftLayers)
118
- this._updateLayers()
119
- return this
120
- },
121
-
122
- setRightLayers: function (rightLayers) {
123
- this._rightLayers = asArray(rightLayers)
124
- this._updateLayers()
125
- return this
126
- },
127
-
128
- _updateClip: function () {
129
- var map = this._map
130
- var nw = map.containerPointToLayerPoint([0, 0])
131
- var se = map.containerPointToLayerPoint(map.getSize())
132
- var clipX = nw.x + this.getPosition()
133
- var dividerX = this.getPosition()
134
-
135
- this._divider.style.left = dividerX + 'px'
136
- this.fire('dividermove', {x: dividerX})
137
- var clipLeft = 'rect(' + [nw.y, clipX, se.y, nw.x].join('px,') + 'px)'
138
- var clipRight = 'rect(' + [nw.y, se.x, se.y, clipX].join('px,') + 'px)'
139
- if (this._leftLayer) {
140
- this._leftLayer.getContainer().style.clip = clipLeft
141
- }
142
- if (this._rightLayer) {
143
- this._rightLayer.getContainer().style.clip = clipRight
144
- }
145
- },
146
-
147
- _updateLayers: function () {
148
- if (!this._map) {
149
- return this
150
- }
151
- var prevLeft = this._leftLayer
152
- var prevRight = this._rightLayer
153
- this._leftLayer = this._rightLayer = null
154
- this._leftLayers.forEach(function (layer) {
155
- if (this._map.hasLayer(layer)) {
156
- this._leftLayer = layer
157
- }
158
- }, this)
159
- this._rightLayers.forEach(function (layer) {
160
- if (this._map.hasLayer(layer)) {
161
- this._rightLayer = layer
162
- }
163
- }, this)
164
- if (prevLeft !== this._leftLayer) {
165
- prevLeft && this.fire('leftlayerremove', {layer: prevLeft})
166
- this._leftLayer && this.fire('leftlayeradd', {layer: this._leftLayer})
167
- }
168
- if (prevRight !== this._rightLayer) {
169
- prevRight && this.fire('rightlayerremove', {layer: prevRight})
170
- this._rightLayer && this.fire('rightlayeradd', {layer: this._rightLayer})
171
- }
172
- this._updateClip()
173
- },
174
-
175
- _addEvents: function () {
176
- var range = this._range
177
- var map = this._map
178
- if (!map || !range) return
179
- map.on('move', this._updateClip, this)
180
- map.on('layeradd layerremove', this._updateLayers, this)
181
- on(range, getRangeEvent(range), this._updateClip, this)
182
- on(range, L.Browser.touch ? 'touchstart' : 'mousedown', cancelMapDrag, this)
183
- on(range, L.Browser.touch ? 'touchend' : 'mouseup', uncancelMapDrag, this)
184
- },
185
-
186
- _removeEvents: function () {
187
- var range = this._range
188
- var map = this._map
189
- if (range) {
190
- off(range, getRangeEvent(range), this._updateClip, this)
191
- off(range, L.Browser.touch ? 'touchstart' : 'mousedown', cancelMapDrag, this)
192
- off(range, L.Browser.touch ? 'touchend' : 'mouseup', uncancelMapDrag, this)
193
- }
194
- if (map) {
195
- map.off('layeradd layerremove', this._updateLayers, this)
196
- map.off('move', this._updateClip, this)
197
- }
198
- }
199
- })
200
-
201
- L.control.sideBySide = function (leftLayers, rightLayers, options) {
202
- return new L.Control.SideBySide(leftLayers, rightLayers, options)
203
- }
204
-
205
- module.exports = L.Control.SideBySide
206
-
207
- }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
208
- },{"./layout.css":2,"./range.css":4}],2:[function(require,module,exports){
209
- var inject = require('./node_modules/cssify');
210
- var css = ".leaflet-sbs-range {\r\n position: absolute;\r\n top: 50%;\r\n width: 100%;\r\n z-index: 999;\r\n}\r\n.leaflet-sbs-divider {\r\n position: absolute;\r\n top: 0;\r\n bottom: 0;\r\n left: 50%;\r\n margin-left: -2px;\r\n width: 4px;\r\n background-color: #fff;\r\n pointer-events: none;\r\n z-index: 999;\r\n}\r\n";
211
- inject(css, undefined, '_i6aomd');
212
- module.exports = css;
213
-
214
- },{"./node_modules/cssify":3}],3:[function(require,module,exports){
215
- 'use strict'
216
-
217
- function injectStyleTag (document, fileName, cb) {
218
- var style = document.getElementById(fileName)
219
-
220
- if (style) {
221
- cb(style)
222
- } else {
223
- var head = document.getElementsByTagName('head')[0]
224
-
225
- style = document.createElement('style')
226
- if (fileName != null) style.id = fileName
227
- cb(style)
228
- head.appendChild(style)
229
- }
230
-
231
- return style
232
- }
233
-
234
- module.exports = function (css, customDocument, fileName) {
235
- var doc = customDocument || document
236
- /* istanbul ignore if: not supported by Electron */
237
- if (doc.createStyleSheet) {
238
- var sheet = doc.createStyleSheet()
239
- sheet.cssText = css
240
- return sheet.ownerNode
241
- } else {
242
- return injectStyleTag(doc, fileName, function (style) {
243
- /* istanbul ignore if: not supported by Electron */
244
- if (style.styleSheet) {
245
- style.styleSheet.cssText = css
246
- } else {
247
- style.innerHTML = css
248
- }
249
- })
250
- }
251
- }
252
-
253
- module.exports.byUrl = function (url) {
254
- /* istanbul ignore if: not supported by Electron */
255
- if (document.createStyleSheet) {
256
- return document.createStyleSheet(url).ownerNode
257
- } else {
258
- var head = document.getElementsByTagName('head')[0]
259
- var link = document.createElement('link')
260
-
261
- link.rel = 'stylesheet'
262
- link.href = url
263
-
264
- head.appendChild(link)
265
- return link
266
- }
267
- }
268
-
269
- },{}],4:[function(require,module,exports){
270
- var inject = require('./node_modules/cssify');
271
- var css = ".leaflet-sbs-range {\r\n -webkit-appearance: none;\r\n display: inline-block!important;\r\n vertical-align: middle;\r\n height: 0;\r\n padding: 0;\r\n margin: 0;\r\n border: 0;\r\n background: rgba(0, 0, 0, 0.25);\r\n min-width: 100px;\r\n cursor: pointer;\r\n pointer-events: none;\r\n z-index: 999;\r\n}\r\n.leaflet-sbs-range::-ms-fill-upper {\r\n background: transparent;\r\n}\r\n.leaflet-sbs-range::-ms-fill-lower {\r\n background: rgba(255, 255, 255, 0.25);\r\n}\r\n/* Browser thingies */\r\n\r\n.leaflet-sbs-range::-moz-range-track {\r\n opacity: 0;\r\n}\r\n.leaflet-sbs-range::-ms-track {\r\n opacity: 0;\r\n}\r\n.leaflet-sbs-range::-ms-tooltip {\r\n display: none;\r\n}\r\n/* For whatever reason, these need to be defined\r\n * on their own so dont group them */\r\n\r\n.leaflet-sbs-range::-webkit-slider-thumb {\r\n -webkit-appearance: none;\r\n margin: 0;\r\n padding: 0;\r\n background: #fff;\r\n height: 40px;\r\n width: 40px;\r\n border-radius: 20px;\r\n cursor: ew-resize;\r\n pointer-events: auto;\r\n border: 1px solid #ddd;\r\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC\");\r\n background-position: 50% 50%;\r\n background-repeat: no-repeat;\r\n background-size: 40px 40px;\r\n}\r\n.leaflet-sbs-range::-ms-thumb {\r\n margin: 0;\r\n padding: 0;\r\n background: #fff;\r\n height: 40px;\r\n width: 40px;\r\n border-radius: 20px;\r\n cursor: ew-resize;\r\n pointer-events: auto;\r\n border: 1px solid #ddd;\r\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC\");\r\n background-position: 50% 50%;\r\n background-repeat: no-repeat;\r\n background-size: 40px 40px;\r\n}\r\n.leaflet-sbs-range::-moz-range-thumb {\r\n padding: 0;\r\n right: 0 ;\r\n background: #fff;\r\n height: 40px;\r\n width: 40px;\r\n border-radius: 20px;\r\n cursor: ew-resize;\r\n pointer-events: auto;\r\n border: 1px solid #ddd;\r\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC\");\r\n background-position: 50% 50%;\r\n background-repeat: no-repeat;\r\n background-size: 40px 40px;\r\n}\r\n.leaflet-sbs-range:disabled::-moz-range-thumb {\r\n cursor: default;\r\n}\r\n.leaflet-sbs-range:disabled::-ms-thumb {\r\n cursor: default;\r\n}\r\n.leaflet-sbs-range:disabled::-webkit-slider-thumb {\r\n cursor: default;\r\n}\r\n.leaflet-sbs-range:disabled {\r\n cursor: default;\r\n}\r\n.leaflet-sbs-range:focus {\r\n outline: none!important;\r\n}\r\n.leaflet-sbs-range::-moz-focus-outer {\r\n border: 0;\r\n}\r\n\r\n";
272
- inject(css, undefined, '_1tlt668');
273
- module.exports = css;
274
-
275
- },{"./node_modules/cssify":3}]},{},[1]);
1
+ (function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r) }, p, p.exports, r, e, n, t) } return n[i].exports } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++)o(t[i]); return o } return r })()({
2
+ 1: [function (require, module, exports) {
3
+ (function (global) {
4
+ var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null)
5
+ require('./layout.css')
6
+ require('./range.css')
7
+
8
+ var mapWasDragEnabled
9
+ var mapWasTapEnabled
10
+
11
+ // Leaflet v0.7 backwards compatibility
12
+ function on(el, types, fn, context) {
13
+ types.split(' ').forEach(function (type) {
14
+ L.DomEvent.on(el, type, fn, context)
15
+ })
16
+ }
17
+
18
+ // Leaflet v0.7 backwards compatibility
19
+ function off(el, types, fn, context) {
20
+ types.split(' ').forEach(function (type) {
21
+ L.DomEvent.off(el, type, fn, context)
22
+ })
23
+ }
24
+
25
+ function getRangeEvent(rangeInput) {
26
+ return 'oninput' in rangeInput ? 'input' : 'change'
27
+ }
28
+
29
+ function cancelMapDrag() {
30
+ mapWasDragEnabled = this._map.dragging.enabled()
31
+ mapWasTapEnabled = this._map.tap && this._map.tap.enabled()
32
+ this._map.dragging.disable()
33
+ this._map.tap && this._map.tap.disable()
34
+ }
35
+
36
+ function uncancelMapDrag(e) {
37
+ this._refocusOnMap(e)
38
+ if (mapWasDragEnabled) {
39
+ this._map.dragging.enable()
40
+ }
41
+ if (mapWasTapEnabled) {
42
+ this._map.tap.enable()
43
+ }
44
+ }
45
+
46
+ // convert arg to an array - returns empty array if arg is undefined
47
+ function asArray(arg) {
48
+ return (arg === 'undefined') ? [] : Array.isArray(arg) ? arg : [arg]
49
+ }
50
+
51
+ function noop() { }
52
+
53
+ L.Control.SideBySide = L.Control.extend({
54
+ options: {
55
+ thumbSize: 42,
56
+ padding: 0
57
+ },
58
+
59
+ initialize: function (leftLayers, rightLayers, options) {
60
+ this.setLeftLayers(leftLayers)
61
+ this.setRightLayers(rightLayers)
62
+ L.setOptions(this, options)
63
+ },
64
+
65
+ getPosition: function () {
66
+ var rangeValue = this._range.value
67
+ var offset = (0.5 - rangeValue) * (2 * this.options.padding + this.options.thumbSize)
68
+ return this._map.getSize().x * rangeValue + offset
69
+ },
70
+
71
+ setPosition: noop,
72
+
73
+ includes: L.Evented.prototype || L.Mixin.Events,
74
+
75
+ addTo: function (map) {
76
+ this.remove()
77
+ this._map = map
78
+
79
+ var container = this._container = L.DomUtil.create('div', 'leaflet-sbs', map._controlContainer)
80
+
81
+ this._divider = L.DomUtil.create('div', 'leaflet-sbs-divider', container)
82
+ var range = this._range = L.DomUtil.create('input', 'leaflet-sbs-range', container)
83
+ range.type = 'range'
84
+ range.min = 0
85
+ range.max = 1
86
+ range.step = 'any'
87
+ range.value = 0.5
88
+ range.style.paddingLeft = range.style.paddingRight = this.options.padding + 'px'
89
+ this._addEvents()
90
+ this._updateLayers()
91
+ return this
92
+ },
93
+
94
+ setSplit: function (s) {
95
+ this._range.value = s / 100;
96
+ this._updateClip();
97
+ },
98
+
99
+ remove: function () {
100
+ if (!this._map) {
101
+ return this
102
+ }
103
+ if (this._leftLayer) {
104
+ this._leftLayer.getContainer().style.clip = ''
105
+ }
106
+ if (this._rightLayer) {
107
+ this._rightLayer.getContainer().style.clip = ''
108
+ }
109
+ this._removeEvents()
110
+ L.DomUtil.remove(this._container)
111
+
112
+ this._map = null
113
+
114
+ return this
115
+ },
116
+
117
+ setLeftLayers: function (leftLayers) {
118
+ this._leftLayers = asArray(leftLayers)
119
+ this._updateLayers()
120
+ return this
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
+ },
148
+
149
+ _updateLayers: function () {
150
+ if (!this._map) {
151
+ return this
152
+ }
153
+ var prevLeft = this._leftLayer
154
+ var prevRight = this._rightLayer
155
+ this._leftLayer = this._rightLayer = null
156
+ this._leftLayers.forEach(function (layer) {
157
+ if (this._map.hasLayer(layer)) {
158
+ this._leftLayer = layer
159
+ }
160
+ }, this)
161
+ this._rightLayers.forEach(function (layer) {
162
+ if (this._map.hasLayer(layer)) {
163
+ this._rightLayer = layer
164
+ }
165
+ }, this)
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
+ })
202
+
203
+ L.control.sideBySide = function (leftLayers, rightLayers, options) {
204
+ return new L.Control.SideBySide(leftLayers, rightLayers, options)
205
+ }
206
+
207
+ module.exports = L.Control.SideBySide
208
+
209
+ }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
210
+ }, { "./layout.css": 2, "./range.css": 4 }], 2: [function (require, module, exports) {
211
+ var inject = require('./node_modules/cssify');
212
+ var css = ".leaflet-sbs-range {\r\n position: absolute;\r\n top: 50%;\r\n width: 100%;\r\n z-index: 999;\r\n}\r\n.leaflet-sbs-divider {\r\n position: absolute;\r\n top: 0;\r\n bottom: 0;\r\n left: 50%;\r\n margin-left: -2px;\r\n width: 4px;\r\n background-color: #fff;\r\n pointer-events: none;\r\n z-index: 999;\r\n}\r\n";
213
+ inject(css, undefined, '_i6aomd');
214
+ module.exports = css;
215
+
216
+ }, { "./node_modules/cssify": 3 }], 3: [function (require, module, exports) {
217
+ 'use strict'
218
+
219
+ function injectStyleTag(document, fileName, cb) {
220
+ var style = document.getElementById(fileName)
221
+
222
+ if (style) {
223
+ cb(style)
224
+ } else {
225
+ var head = document.getElementsByTagName('head')[0]
226
+
227
+ style = document.createElement('style')
228
+ if (fileName != null) style.id = fileName
229
+ cb(style)
230
+ head.appendChild(style)
231
+ }
232
+
233
+ return style
234
+ }
235
+
236
+ module.exports = function (css, customDocument, fileName) {
237
+ var doc = customDocument || document
238
+ /* istanbul ignore if: not supported by Electron */
239
+ if (doc.createStyleSheet) {
240
+ var sheet = doc.createStyleSheet()
241
+ sheet.cssText = css
242
+ return sheet.ownerNode
243
+ } else {
244
+ return injectStyleTag(doc, fileName, function (style) {
245
+ /* istanbul ignore if: not supported by Electron */
246
+ if (style.styleSheet) {
247
+ style.styleSheet.cssText = css
248
+ } else {
249
+ style.innerHTML = css
250
+ }
251
+ })
252
+ }
253
+ }
254
+
255
+ module.exports.byUrl = function (url) {
256
+ /* istanbul ignore if: not supported by Electron */
257
+ if (document.createStyleSheet) {
258
+ return document.createStyleSheet(url).ownerNode
259
+ } else {
260
+ var head = document.getElementsByTagName('head')[0]
261
+ var link = document.createElement('link')
262
+
263
+ link.rel = 'stylesheet'
264
+ link.href = url
265
+
266
+ head.appendChild(link)
267
+ return link
268
+ }
269
+ }
270
+
271
+ }, {}], 4: [function (require, module, exports) {
272
+ var inject = require('./node_modules/cssify');
273
+ var css = ".leaflet-sbs-range {\r\n -webkit-appearance: none;\r\n display: inline-block!important;\r\n vertical-align: middle;\r\n height: 0;\r\n padding: 0;\r\n margin: 0;\r\n border: 0;\r\n background: rgba(0, 0, 0, 0.25);\r\n min-width: 100px;\r\n cursor: pointer;\r\n pointer-events: none;\r\n z-index: 999;\r\n}\r\n.leaflet-sbs-range::-ms-fill-upper {\r\n background: transparent;\r\n}\r\n.leaflet-sbs-range::-ms-fill-lower {\r\n background: rgba(255, 255, 255, 0.25);\r\n}\r\n/* Browser thingies */\r\n\r\n.leaflet-sbs-range::-moz-range-track {\r\n opacity: 0;\r\n}\r\n.leaflet-sbs-range::-ms-track {\r\n opacity: 0;\r\n}\r\n.leaflet-sbs-range::-ms-tooltip {\r\n display: none;\r\n}\r\n/* For whatever reason, these need to be defined\r\n * on their own so dont group them */\r\n\r\n.leaflet-sbs-range::-webkit-slider-thumb {\r\n -webkit-appearance: none;\r\n margin: 0;\r\n padding: 0;\r\n background: #fff;\r\n height: 40px;\r\n width: 40px;\r\n border-radius: 20px;\r\n cursor: ew-resize;\r\n pointer-events: auto;\r\n border: 1px solid #ddd;\r\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC\");\r\n background-position: 50% 50%;\r\n background-repeat: no-repeat;\r\n background-size: 40px 40px;\r\n}\r\n.leaflet-sbs-range::-ms-thumb {\r\n margin: 0;\r\n padding: 0;\r\n background: #fff;\r\n height: 40px;\r\n width: 40px;\r\n border-radius: 20px;\r\n cursor: ew-resize;\r\n pointer-events: auto;\r\n border: 1px solid #ddd;\r\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC\");\r\n background-position: 50% 50%;\r\n background-repeat: no-repeat;\r\n background-size: 40px 40px;\r\n}\r\n.leaflet-sbs-range::-moz-range-thumb {\r\n padding: 0;\r\n right: 0 ;\r\n background: #fff;\r\n height: 40px;\r\n width: 40px;\r\n border-radius: 20px;\r\n cursor: ew-resize;\r\n pointer-events: auto;\r\n border: 1px solid #ddd;\r\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC\");\r\n background-position: 50% 50%;\r\n background-repeat: no-repeat;\r\n background-size: 40px 40px;\r\n}\r\n.leaflet-sbs-range:disabled::-moz-range-thumb {\r\n cursor: default;\r\n}\r\n.leaflet-sbs-range:disabled::-ms-thumb {\r\n cursor: default;\r\n}\r\n.leaflet-sbs-range:disabled::-webkit-slider-thumb {\r\n cursor: default;\r\n}\r\n.leaflet-sbs-range:disabled {\r\n cursor: default;\r\n}\r\n.leaflet-sbs-range:focus {\r\n outline: none!important;\r\n}\r\n.leaflet-sbs-range::-moz-focus-outer {\r\n border: 0;\r\n}\r\n\r\n";
274
+ inject(css, undefined, '_1tlt668');
275
+ module.exports = css;
276
+
277
+ }, { "./node_modules/cssify": 3 }]
278
+ }, {}, [1]);
@@ -2584,7 +2584,6 @@ function doCommand(cmd) {
2584
2584
  overlays[cmd.map.overlay].addTo(map);
2585
2585
  }
2586
2586
  }
2587
-
2588
2587
  // Swap a base layer
2589
2588
  if (cmd.layer && basemaps.hasOwnProperty(cmd.layer)) {
2590
2589
  map.removeLayer(basemaps[baselayername]);
@@ -2668,10 +2667,13 @@ function doCommand(cmd) {
2668
2667
  document.getElementById("maxage").value = cmd.maxage;
2669
2668
  setMaxAge();
2670
2669
  }
2671
- if (cmd.hasOwnProperty("heatmap")) {
2672
- heat.setOptions(cmd.heatmap);
2673
- document.getElementById("heatall").checked = !!cmd.heatmap;
2674
- heat.redraw();
2670
+ // Replace heatmap layer with new array (and optionally options)
2671
+ if (cmd.hasOwnProperty("heatmap") && heat) {
2672
+ if (cmd.hasOwnProperty("options")) { heat.setOptions(cmd.options); }
2673
+ heat.setLatLngs(cmd.heatmap);
2674
+ // heat.setOptions(cmd.heatmap);
2675
+ // document.getElementById("heatall").checked = !!cmd.heatmap;
2676
+ // heat.redraw();
2675
2677
  }
2676
2678
  if (cmd.hasOwnProperty("panlock") && lockit === true) { doLock(true); }
2677
2679
  if (cmd.hasOwnProperty("zoomlock")) {
package/worldmap.html CHANGED
@@ -1,4 +1,3 @@
1
- <!DOCTYPE html>
2
1
  <script type="text/html" data-template-name="worldmap">
3
2
  <div class="form-row">
4
3
  <table border="0" width="96%">