@vtx/cs-map 1.0.11 → 1.0.13
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/lib/feature-layer/FeatureLayer.js +35 -18
- package/lib/feature-layer/FeatureLayer.js.map +1 -1
- package/lib/feature-layer/index.js +4 -4
- package/lib/feature-layer/index.js.map +1 -1
- package/lib/heatmap-layer/heatmap.js +612 -0
- package/lib/heatmap-layer/heatmap.js.map +1 -0
- package/lib/heatmap-layer/index.js +41 -8
- package/lib/heatmap-layer/index.js.map +1 -1
- package/lib/image-layer/ImageLayer.js +22 -22
- package/lib/image-layer/ImageLayer.js.map +1 -1
- package/lib/image-layer/index.js +6 -6
- package/lib/image-layer/index.js.map +1 -1
- package/lib/legend/index.js +85 -61
- package/lib/legend/index.js.map +1 -1
- package/lib/map/Layers.js +10 -10
- package/lib/map/Layers.js.map +1 -1
- package/lib/map/index.js +3 -1
- package/lib/map/index.js.map +1 -1
- package/lib/tools/layer/index.js +26 -7
- package/lib/tools/layer/index.js.map +1 -1
- package/package.json +1 -1
- package/lib/heatmap-layer/CesiumHeatmap.js +0 -345
- package/lib/heatmap-layer/CesiumHeatmap.js.map +0 -1
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
var Cesium = _interopRequireWildcard(require("cesium"));
|
|
5
|
-
var _heatmap = _interopRequireDefault(require("heatmap.js"));
|
|
6
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
7
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
8
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
9
|
-
/*
|
|
10
|
-
* CesiumHeatmap.js v0.1 | Cesium Heatmap Library
|
|
11
|
-
*
|
|
12
|
-
* Works with heatmap.js v2.0.0: http://www.patrick-wied.at/static/heatmapjs/
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
(function (window) {
|
|
16
|
-
'use strict';
|
|
17
|
-
|
|
18
|
-
function define_CesiumHeatmap() {
|
|
19
|
-
var CesiumHeatmap = {
|
|
20
|
-
defaults: {
|
|
21
|
-
useEntitiesIfAvailable: true,
|
|
22
|
-
//whether to use entities if a Viewer is supplied or always use an ImageryProvider
|
|
23
|
-
minCanvasSize: 700,
|
|
24
|
-
// minimum size (in pixels) for the heatmap canvas
|
|
25
|
-
maxCanvasSize: 2000,
|
|
26
|
-
// maximum size (in pixels) for the heatmap canvas
|
|
27
|
-
radiusFactor: 60,
|
|
28
|
-
// data point size factor used if no radius is given (the greater of height and width divided by this number yields the used radius)
|
|
29
|
-
spacingFactor: 1.5,
|
|
30
|
-
// extra space around the borders (point radius multiplied by this number yields the spacing)
|
|
31
|
-
maxOpacity: 0.8,
|
|
32
|
-
// the maximum opacity used if not given in the heatmap options object
|
|
33
|
-
minOpacity: 0.1,
|
|
34
|
-
// the minimum opacity used if not given in the heatmap options object
|
|
35
|
-
blur: 0.85,
|
|
36
|
-
// the blur used if not given in the heatmap options object
|
|
37
|
-
gradient: {
|
|
38
|
-
// the gradient used if not given in the heatmap options object
|
|
39
|
-
'.3': 'blue',
|
|
40
|
-
'.65': 'yellow',
|
|
41
|
-
'.8': 'orange',
|
|
42
|
-
'.95': 'red'
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/* Create a CesiumHeatmap instance
|
|
48
|
-
*
|
|
49
|
-
* cesium: the CesiumWidget or Viewer instance
|
|
50
|
-
* bb: the WGS84 bounding box like {north, east, south, west}
|
|
51
|
-
* options: a heatmap.js options object (see http://www.patrick-wied.at/static/heatmapjs/docs.html#h337-create)
|
|
52
|
-
*/
|
|
53
|
-
CesiumHeatmap.create = function (cesium, bb, options) {
|
|
54
|
-
var instance = new CHInstance(cesium, bb, options);
|
|
55
|
-
return instance;
|
|
56
|
-
};
|
|
57
|
-
CesiumHeatmap._getContainer = function (width, height, id) {
|
|
58
|
-
var c = document.createElement("div");
|
|
59
|
-
if (id) {
|
|
60
|
-
c.setAttribute("id", id);
|
|
61
|
-
}
|
|
62
|
-
c.setAttribute("style", "width: " + width + "px; height: " + height + "px; margin: 0px; display: none;");
|
|
63
|
-
document.body.appendChild(c);
|
|
64
|
-
return c;
|
|
65
|
-
};
|
|
66
|
-
CesiumHeatmap._getImageryProvider = function (instance) {
|
|
67
|
-
//var n = (new Date()).getTime();
|
|
68
|
-
var d = instance._heatmap.getDataURL();
|
|
69
|
-
//console.log("Create data URL: " + ((new Date()).getTime() - n));
|
|
70
|
-
|
|
71
|
-
//var n = (new Date()).getTime();
|
|
72
|
-
var imgprov = new Cesium.SingleTileImageryProvider({
|
|
73
|
-
url: d,
|
|
74
|
-
rectangle: instance._rectangle
|
|
75
|
-
});
|
|
76
|
-
//console.log("Create imageryprovider: " + ((new Date()).getTime() - n));
|
|
77
|
-
|
|
78
|
-
imgprov._tilingScheme = new Cesium.WebMercatorTilingScheme({
|
|
79
|
-
rectangleSouthwestInMeters: new Cesium.Cartesian2(instance._mbounds.west, instance._mbounds.south),
|
|
80
|
-
rectangleNortheastInMeters: new Cesium.Cartesian2(instance._mbounds.east, instance._mbounds.north)
|
|
81
|
-
});
|
|
82
|
-
return imgprov;
|
|
83
|
-
};
|
|
84
|
-
CesiumHeatmap._getID = function (len) {
|
|
85
|
-
var text = "";
|
|
86
|
-
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
87
|
-
for (var i = 0; i < (len ? len : 8); i++) text += possible.charAt(Math.floor(Math.random() * possible.length));
|
|
88
|
-
return text;
|
|
89
|
-
};
|
|
90
|
-
var WMP = new Cesium.WebMercatorProjection();
|
|
91
|
-
|
|
92
|
-
/* Convert a WGS84 location into a mercator location
|
|
93
|
-
*
|
|
94
|
-
* p: the WGS84 location like {x: lon, y: lat}
|
|
95
|
-
*/
|
|
96
|
-
CesiumHeatmap.wgs84ToMercator = function (p) {
|
|
97
|
-
var mp = WMP.project(Cesium.Cartographic.fromDegrees(p.x, p.y));
|
|
98
|
-
return {
|
|
99
|
-
x: mp.x,
|
|
100
|
-
y: mp.y
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
/* Convert a WGS84 bounding box into a mercator bounding box
|
|
105
|
-
*
|
|
106
|
-
* bb: the WGS84 bounding box like {north, east, south, west}
|
|
107
|
-
*/
|
|
108
|
-
CesiumHeatmap.wgs84ToMercatorBB = function (bb) {
|
|
109
|
-
var sw = WMP.project(Cesium.Cartographic.fromDegrees(bb.west, bb.south));
|
|
110
|
-
var ne = WMP.project(Cesium.Cartographic.fromDegrees(bb.east, bb.north));
|
|
111
|
-
return {
|
|
112
|
-
north: ne.y,
|
|
113
|
-
east: ne.x,
|
|
114
|
-
south: sw.y,
|
|
115
|
-
west: sw.x
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
/* Convert a mercator location into a WGS84 location
|
|
120
|
-
*
|
|
121
|
-
* p: the mercator lcation like {x, y}
|
|
122
|
-
*/
|
|
123
|
-
CesiumHeatmap.mercatorToWgs84 = function (p) {
|
|
124
|
-
var wp = WMP.unproject(new Cesium.Cartesian3(p.x, p.y));
|
|
125
|
-
return {
|
|
126
|
-
x: wp.longitude,
|
|
127
|
-
y: wp.latitude
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
/* Convert a mercator bounding box into a WGS84 bounding box
|
|
132
|
-
*
|
|
133
|
-
* bb: the mercator bounding box like {north, east, south, west}
|
|
134
|
-
*/
|
|
135
|
-
CesiumHeatmap.mercatorToWgs84BB = function (bb) {
|
|
136
|
-
var sw = WMP.unproject(new Cesium.Cartesian3(bb.west, bb.south));
|
|
137
|
-
var ne = WMP.unproject(new Cesium.Cartesian3(bb.east, bb.north));
|
|
138
|
-
return {
|
|
139
|
-
north: this.rad2deg(ne.latitude),
|
|
140
|
-
east: this.rad2deg(ne.longitude),
|
|
141
|
-
south: this.rad2deg(sw.latitude),
|
|
142
|
-
west: this.rad2deg(sw.longitude)
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
/* Convert degrees into radians
|
|
147
|
-
*
|
|
148
|
-
* d: the degrees to be converted to radians
|
|
149
|
-
*/
|
|
150
|
-
CesiumHeatmap.deg2rad = function (d) {
|
|
151
|
-
var r = d * (Math.PI / 180.0);
|
|
152
|
-
return r;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
/* Convert radians into degrees
|
|
156
|
-
*
|
|
157
|
-
* r: the radians to be converted to degrees
|
|
158
|
-
*/
|
|
159
|
-
CesiumHeatmap.rad2deg = function (r) {
|
|
160
|
-
var d = r / (Math.PI / 180.0);
|
|
161
|
-
return d;
|
|
162
|
-
};
|
|
163
|
-
return CesiumHeatmap;
|
|
164
|
-
}
|
|
165
|
-
if (typeof CesiumHeatmap === 'undefined') {
|
|
166
|
-
window.CesiumHeatmap = define_CesiumHeatmap();
|
|
167
|
-
} else {
|
|
168
|
-
console.log("CesiumHeatmap already defined.");
|
|
169
|
-
}
|
|
170
|
-
})(window);
|
|
171
|
-
|
|
172
|
-
/* Initiate a CesiumHeatmap instance
|
|
173
|
-
*
|
|
174
|
-
* c: CesiumWidget instance
|
|
175
|
-
* bb: a WGS84 bounding box like {north, east, south, west}
|
|
176
|
-
* o: a heatmap.js options object (see http://www.patrick-wied.at/static/heatmapjs/docs.html#h337-create)
|
|
177
|
-
*/
|
|
178
|
-
function CHInstance(c, bb, o) {
|
|
179
|
-
if (!bb) {
|
|
180
|
-
return null;
|
|
181
|
-
}
|
|
182
|
-
if (!o) {
|
|
183
|
-
o = {};
|
|
184
|
-
}
|
|
185
|
-
this._cesium = c;
|
|
186
|
-
this._options = o;
|
|
187
|
-
this._id = CesiumHeatmap._getID();
|
|
188
|
-
this._options.gradient = this._options.gradient ? this._options.gradient : CesiumHeatmap.defaults.gradient;
|
|
189
|
-
this._options.maxOpacity = this._options.maxOpacity ? this._options.maxOpacity : CesiumHeatmap.defaults.maxOpacity;
|
|
190
|
-
this._options.minOpacity = this._options.minOpacity ? this._options.minOpacity : CesiumHeatmap.defaults.minOpacity;
|
|
191
|
-
this._options.blur = this._options.blur ? this._options.blur : CesiumHeatmap.defaults.blur;
|
|
192
|
-
this._mbounds = CesiumHeatmap.wgs84ToMercatorBB(bb);
|
|
193
|
-
this._setWidthAndHeight(this._mbounds);
|
|
194
|
-
this._options.radius = Math.round(this._options.radius ? this._options.radius : this.width > this.height ? this.width / CesiumHeatmap.defaults.radiusFactor : this.height / CesiumHeatmap.defaults.radiusFactor);
|
|
195
|
-
this._spacing = this._options.radius * CesiumHeatmap.defaults.spacingFactor;
|
|
196
|
-
this._xoffset = this._mbounds.west;
|
|
197
|
-
this._yoffset = this._mbounds.south;
|
|
198
|
-
this.width = Math.round(this.width + this._spacing * 2);
|
|
199
|
-
this.height = Math.round(this.height + this._spacing * 2);
|
|
200
|
-
this._mbounds.west -= this._spacing * this._factor;
|
|
201
|
-
this._mbounds.east += this._spacing * this._factor;
|
|
202
|
-
this._mbounds.south -= this._spacing * this._factor;
|
|
203
|
-
this._mbounds.north += this._spacing * this._factor;
|
|
204
|
-
this.bounds = CesiumHeatmap.mercatorToWgs84BB(this._mbounds);
|
|
205
|
-
this._rectangle = Cesium.Rectangle.fromDegrees(this.bounds.west, this.bounds.south, this.bounds.east, this.bounds.north);
|
|
206
|
-
this._container = CesiumHeatmap._getContainer(this.width, this.height, this._id);
|
|
207
|
-
this._options.container = this._container;
|
|
208
|
-
this._heatmap = _heatmap["default"].create(this._options);
|
|
209
|
-
this._container.children[0].setAttribute("id", this._id + "-hm");
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/* Convert a WGS84 location to the corresponding heatmap location
|
|
213
|
-
*
|
|
214
|
-
* p: a WGS84 location like {x:lon, y:lat}
|
|
215
|
-
*/
|
|
216
|
-
CHInstance.prototype.wgs84PointToHeatmapPoint = function (p) {
|
|
217
|
-
return this.mercatorPointToHeatmapPoint(CesiumHeatmap.wgs84ToMercator(p));
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
/* Convert a mercator location to the corresponding heatmap location
|
|
221
|
-
*
|
|
222
|
-
* p: a WGS84 location like {x: lon, y:lat}
|
|
223
|
-
*/
|
|
224
|
-
CHInstance.prototype.mercatorPointToHeatmapPoint = function (p) {
|
|
225
|
-
var pn = {};
|
|
226
|
-
pn.x = Math.round((p.x - this._xoffset) / this._factor + this._spacing);
|
|
227
|
-
pn.y = Math.round((p.y - this._yoffset) / this._factor + this._spacing);
|
|
228
|
-
pn.y = this.height - pn.y;
|
|
229
|
-
return pn;
|
|
230
|
-
};
|
|
231
|
-
CHInstance.prototype._setWidthAndHeight = function (mbb) {
|
|
232
|
-
this.width = mbb.east > 0 && mbb.west < 0 ? mbb.east + Math.abs(mbb.west) : Math.abs(mbb.east - mbb.west);
|
|
233
|
-
this.height = mbb.north > 0 && mbb.south < 0 ? mbb.north + Math.abs(mbb.south) : Math.abs(mbb.north - mbb.south);
|
|
234
|
-
this._factor = 1;
|
|
235
|
-
if (this.width > this.height && this.width > CesiumHeatmap.defaults.maxCanvasSize) {
|
|
236
|
-
this._factor = this.width / CesiumHeatmap.defaults.maxCanvasSize;
|
|
237
|
-
if (this.height / this._factor < CesiumHeatmap.defaults.minCanvasSize) {
|
|
238
|
-
this._factor = this.height / CesiumHeatmap.defaults.minCanvasSize;
|
|
239
|
-
}
|
|
240
|
-
} else if (this.height > this.width && this.height > CesiumHeatmap.defaults.maxCanvasSize) {
|
|
241
|
-
this._factor = this.height / CesiumHeatmap.defaults.maxCanvasSize;
|
|
242
|
-
if (this.width / this._factor < CesiumHeatmap.defaults.minCanvasSize) {
|
|
243
|
-
this._factor = this.width / CesiumHeatmap.defaults.minCanvasSize;
|
|
244
|
-
}
|
|
245
|
-
} else if (this.width < this.height && this.width < CesiumHeatmap.defaults.minCanvasSize) {
|
|
246
|
-
this._factor = this.width / CesiumHeatmap.defaults.minCanvasSize;
|
|
247
|
-
if (this.height / this._factor > CesiumHeatmap.defaults.maxCanvasSize) {
|
|
248
|
-
this._factor = this.height / CesiumHeatmap.defaults.maxCanvasSize;
|
|
249
|
-
}
|
|
250
|
-
} else if (this.height < this.width && this.height < CesiumHeatmap.defaults.minCanvasSize) {
|
|
251
|
-
this._factor = this.height / CesiumHeatmap.defaults.minCanvasSize;
|
|
252
|
-
if (this.width / this._factor > CesiumHeatmap.defaults.maxCanvasSize) {
|
|
253
|
-
this._factor = this.width / CesiumHeatmap.defaults.maxCanvasSize;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
this.width = this.width / this._factor;
|
|
257
|
-
this.height = this.height / this._factor;
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
/* Set an array of heatmap locations
|
|
261
|
-
*
|
|
262
|
-
* min: the minimum allowed value for the data values
|
|
263
|
-
* max: the maximum allowed value for the data values
|
|
264
|
-
* data: an array of data points in heatmap coordinates and values like {x, y, value}
|
|
265
|
-
*/
|
|
266
|
-
CHInstance.prototype.setData = function (min, max, data) {
|
|
267
|
-
if (data && data.length > 0 && min !== null && min !== false && max !== null && max !== false) {
|
|
268
|
-
this._heatmap.setData({
|
|
269
|
-
min: min,
|
|
270
|
-
max: max,
|
|
271
|
-
data: data
|
|
272
|
-
});
|
|
273
|
-
this.updateLayer();
|
|
274
|
-
return true;
|
|
275
|
-
}
|
|
276
|
-
return false;
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
/* Set an array of WGS84 locations
|
|
280
|
-
*
|
|
281
|
-
* min: the minimum allowed value for the data values
|
|
282
|
-
* max: the maximum allowed value for the data values
|
|
283
|
-
* data: an array of data points in WGS84 coordinates and values like { x:lon, y:lat, value }
|
|
284
|
-
*/
|
|
285
|
-
CHInstance.prototype.setWGS84Data = function (min, max, data) {
|
|
286
|
-
if (data && data.length > 0 && min !== null && min !== false && max !== null && max !== false) {
|
|
287
|
-
var convdata = [];
|
|
288
|
-
for (var i = 0; i < data.length; i++) {
|
|
289
|
-
var gp = data[i];
|
|
290
|
-
var hp = this.wgs84PointToHeatmapPoint(gp);
|
|
291
|
-
if (gp.value || gp.value === 0) {
|
|
292
|
-
hp.value = gp.value;
|
|
293
|
-
}
|
|
294
|
-
convdata.push(hp);
|
|
295
|
-
}
|
|
296
|
-
return this.setData(min, max, convdata);
|
|
297
|
-
}
|
|
298
|
-
return false;
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
/* Set whether or not the heatmap is shown on the map
|
|
302
|
-
*
|
|
303
|
-
* s: true means the heatmap is shown, false means the heatmap is hidden
|
|
304
|
-
*/
|
|
305
|
-
CHInstance.prototype.show = function (s) {
|
|
306
|
-
if (this._layer) {
|
|
307
|
-
this._layer.show = s;
|
|
308
|
-
}
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
/* Update/(re)draw the heatmap
|
|
312
|
-
*/
|
|
313
|
-
CHInstance.prototype.updateLayer = function () {
|
|
314
|
-
// only works with a Viewer instance since the cesiumWidget
|
|
315
|
-
// instance doesn't contain an entities property
|
|
316
|
-
if (CesiumHeatmap.defaults.useEntitiesIfAvailable && this._cesium.entities) {
|
|
317
|
-
if (this._layer) {
|
|
318
|
-
this._cesium.entities.remove(this._layer);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
// Work around issue with material rendering in Cesium
|
|
322
|
-
// provided by https://github.com/criis
|
|
323
|
-
var material = new Cesium.ImageMaterialProperty({
|
|
324
|
-
image: this._heatmap._renderer.canvas
|
|
325
|
-
});
|
|
326
|
-
if (Cesium.VERSION >= "1.21") {
|
|
327
|
-
material.transparent = true;
|
|
328
|
-
} else if (Cesium.VERSION >= "1.16") {
|
|
329
|
-
material.alpha = 0.99;
|
|
330
|
-
}
|
|
331
|
-
this._layer = this._cesium.entities.add({
|
|
332
|
-
show: true,
|
|
333
|
-
rectangle: {
|
|
334
|
-
coordinates: this._rectangle,
|
|
335
|
-
material: material
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
} else {
|
|
339
|
-
if (this._layer) {
|
|
340
|
-
this._cesium.scene.imageryLayers.remove(this._layer);
|
|
341
|
-
}
|
|
342
|
-
this._layer = this._cesium.scene.imageryLayers.addImageryProvider(CesiumHeatmap._getImageryProvider(this));
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
//# sourceMappingURL=CesiumHeatmap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CesiumHeatmap.js","names":["Cesium","_interopRequireWildcard","require","_heatmap","_interopRequireDefault","obj","__esModule","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","window","define_CesiumHeatmap","CesiumHeatmap","defaults","useEntitiesIfAvailable","minCanvasSize","maxCanvasSize","radiusFactor","spacingFactor","maxOpacity","minOpacity","blur","gradient","create","cesium","bb","options","instance","CHInstance","_getContainer","width","height","id","c","document","createElement","setAttribute","body","appendChild","_getImageryProvider","d","getDataURL","imgprov","SingleTileImageryProvider","url","rectangle","_rectangle","_tilingScheme","WebMercatorTilingScheme","rectangleSouthwestInMeters","Cartesian2","_mbounds","west","south","rectangleNortheastInMeters","east","north","_getID","len","text","possible","i","charAt","Math","floor","random","length","WMP","WebMercatorProjection","wgs84ToMercator","p","mp","project","Cartographic","fromDegrees","x","y","wgs84ToMercatorBB","sw","ne","mercatorToWgs84","wp","unproject","Cartesian3","longitude","latitude","mercatorToWgs84BB","rad2deg","deg2rad","r","PI","console","log","o","_cesium","_options","_id","_setWidthAndHeight","radius","round","_spacing","_xoffset","_yoffset","_factor","bounds","Rectangle","_container","container","h337","children","wgs84PointToHeatmapPoint","mercatorPointToHeatmapPoint","pn","mbb","abs","setData","min","max","data","updateLayer","setWGS84Data","convdata","gp","hp","value","push","show","s","_layer","entities","remove","material","ImageMaterialProperty","image","_renderer","canvas","VERSION","transparent","alpha","add","coordinates","scene","imageryLayers","addImageryProvider"],"sources":["heatmap-layer/CesiumHeatmap.js"],"sourcesContent":["/*\n * CesiumHeatmap.js v0.1 | Cesium Heatmap Library\n *\n * Works with heatmap.js v2.0.0: http://www.patrick-wied.at/static/heatmapjs/\n */\nimport * as Cesium from 'cesium';\nimport h337 from 'heatmap.js';\n\n(function (window) {\n\t'use strict';\n\n\tfunction define_CesiumHeatmap() {\n\t\tvar CesiumHeatmap = {\n\t\t\tdefaults: {\n\t\t\t\tuseEntitiesIfAvailable: true, //whether to use entities if a Viewer is supplied or always use an ImageryProvider\n\t\t\t\tminCanvasSize: 700, // minimum size (in pixels) for the heatmap canvas\n\t\t\t\tmaxCanvasSize: 2000, // maximum size (in pixels) for the heatmap canvas\n\t\t\t\tradiusFactor: 60, // data point size factor used if no radius is given (the greater of height and width divided by this number yields the used radius)\n\t\t\t\tspacingFactor: 1.5, // extra space around the borders (point radius multiplied by this number yields the spacing)\n\t\t\t\tmaxOpacity: 0.8, // the maximum opacity used if not given in the heatmap options object\n\t\t\t\tminOpacity: 0.1, // the minimum opacity used if not given in the heatmap options object\n\t\t\t\tblur: 0.85, // the blur used if not given in the heatmap options object\n\t\t\t\tgradient: { // the gradient used if not given in the heatmap options object\n\t\t\t\t\t'.3': 'blue',\n\t\t\t\t\t'.65': 'yellow',\n\t\t\t\t\t'.8': 'orange',\n\t\t\t\t\t'.95': 'red'\n\t\t\t\t},\n\t\t\t}\n\t\t};\n\n\t\t/* Create a CesiumHeatmap instance\n\t\t *\n\t\t * cesium: the CesiumWidget or Viewer instance\n\t\t * bb: the WGS84 bounding box like {north, east, south, west}\n\t\t * options: a heatmap.js options object (see http://www.patrick-wied.at/static/heatmapjs/docs.html#h337-create)\n\t\t */\n\t\tCesiumHeatmap.create = function (cesium, bb, options) {\n\t\t\tvar instance = new CHInstance(cesium, bb, options);\n\t\t\treturn instance;\n\t\t};\n\n\t\tCesiumHeatmap._getContainer = function (width, height, id) {\n\t\t\tvar c = document.createElement(\"div\");\n\t\t\tif (id) {\n\t\t\t\tc.setAttribute(\"id\", id);\n\t\t\t}\n\t\t\tc.setAttribute(\"style\", \"width: \" + width + \"px; height: \" + height + \"px; margin: 0px; display: none;\");\n\t\t\tdocument.body.appendChild(c);\n\t\t\treturn c;\n\t\t};\n\n\t\tCesiumHeatmap._getImageryProvider = function (instance) {\n\t\t\t//var n = (new Date()).getTime();\n\t\t\tvar d = instance._heatmap.getDataURL();\n\t\t\t//console.log(\"Create data URL: \" + ((new Date()).getTime() - n));\n\n\t\t\t//var n = (new Date()).getTime();\n\t\t\tvar imgprov = new Cesium.SingleTileImageryProvider({\n\t\t\t\turl: d,\n\t\t\t\trectangle: instance._rectangle\n\t\t\t});\n\t\t\t//console.log(\"Create imageryprovider: \" + ((new Date()).getTime() - n));\n\n\t\t\timgprov._tilingScheme = new Cesium.WebMercatorTilingScheme({\n\t\t\t\trectangleSouthwestInMeters: new Cesium.Cartesian2(instance._mbounds.west, instance._mbounds.south),\n\t\t\t\trectangleNortheastInMeters: new Cesium.Cartesian2(instance._mbounds.east, instance._mbounds.north)\n\t\t\t});\n\n\t\t\treturn imgprov;\n\t\t};\n\n\t\tCesiumHeatmap._getID = function (len) {\n\t\t\tvar text = \"\";\n\t\t\tvar possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n\t\t\tfor (var i = 0; i < ((len) ? len : 8); i++)\n\t\t\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\n\n\t\t\treturn text;\n\t\t};\n\n\t\tvar WMP = new Cesium.WebMercatorProjection();\n\n\t\t/* Convert a WGS84 location into a mercator location\n\t\t *\n\t\t * p: the WGS84 location like {x: lon, y: lat}\n\t\t */\n\t\tCesiumHeatmap.wgs84ToMercator = function (p) {\n\t\t\tvar mp = WMP.project(Cesium.Cartographic.fromDegrees(p.x, p.y));\n\t\t\treturn {\n\t\t\t\tx: mp.x,\n\t\t\t\ty: mp.y\n\t\t\t};\n\t\t};\n\n\t\t/* Convert a WGS84 bounding box into a mercator bounding box\n\t\t *\n\t\t * bb: the WGS84 bounding box like {north, east, south, west}\n\t\t */\n\t\tCesiumHeatmap.wgs84ToMercatorBB = function (bb) {\n\t\t\tvar sw = WMP.project(Cesium.Cartographic.fromDegrees(bb.west, bb.south));\n\t\t\tvar ne = WMP.project(Cesium.Cartographic.fromDegrees(bb.east, bb.north));\n\t\t\treturn {\n\t\t\t\tnorth: ne.y,\n\t\t\t\teast: ne.x,\n\t\t\t\tsouth: sw.y,\n\t\t\t\twest: sw.x\n\t\t\t};\n\t\t};\n\n\t\t/* Convert a mercator location into a WGS84 location\n\t\t *\n\t\t * p: the mercator lcation like {x, y}\n\t\t */\n\t\tCesiumHeatmap.mercatorToWgs84 = function (p) {\n\t\t\tvar wp = WMP.unproject(new Cesium.Cartesian3(p.x, p.y));\n\t\t\treturn {\n\t\t\t\tx: wp.longitude,\n\t\t\t\ty: wp.latitude\n\t\t\t};\n\t\t};\n\n\t\t/* Convert a mercator bounding box into a WGS84 bounding box\n\t\t *\n\t\t * bb: the mercator bounding box like {north, east, south, west}\n\t\t */\n\t\tCesiumHeatmap.mercatorToWgs84BB = function (bb) {\n\t\t\tvar sw = WMP.unproject(new Cesium.Cartesian3(bb.west, bb.south));\n\t\t\tvar ne = WMP.unproject(new Cesium.Cartesian3(bb.east, bb.north));\n\t\t\treturn {\n\t\t\t\tnorth: this.rad2deg(ne.latitude),\n\t\t\t\teast: this.rad2deg(ne.longitude),\n\t\t\t\tsouth: this.rad2deg(sw.latitude),\n\t\t\t\twest: this.rad2deg(sw.longitude)\n\t\t\t};\n\t\t};\n\n\t\t/* Convert degrees into radians\n\t\t *\n\t\t * d: the degrees to be converted to radians\n\t\t */\n\t\tCesiumHeatmap.deg2rad = function (d) {\n\t\t\tvar r = d * (Math.PI / 180.0);\n\t\t\treturn r;\n\t\t};\n\n\t\t/* Convert radians into degrees\n\t\t *\n\t\t * r: the radians to be converted to degrees\n\t\t */\n\t\tCesiumHeatmap.rad2deg = function (r) {\n\t\t\tvar d = r / (Math.PI / 180.0);\n\t\t\treturn d;\n\t\t};\n\n\t\treturn CesiumHeatmap;\n\t}\n\n\tif (typeof(CesiumHeatmap) === 'undefined') {\n\t\twindow.CesiumHeatmap = define_CesiumHeatmap();\n\t} else {\n\t\tconsole.log(\"CesiumHeatmap already defined.\");\n\t}\n})(window);\n\n/* Initiate a CesiumHeatmap instance\n *\n * c: CesiumWidget instance\n * bb: a WGS84 bounding box like {north, east, south, west}\n * o: a heatmap.js options object (see http://www.patrick-wied.at/static/heatmapjs/docs.html#h337-create)\n */\nfunction CHInstance(c, bb, o) {\n\tif (!bb) {\n\t\treturn null;\n\t}\n\tif (!o) {\n\t\to = {};\n\t}\n\n\tthis._cesium = c;\n\tthis._options = o;\n\tthis._id = CesiumHeatmap._getID();\n\n\tthis._options.gradient = ((this._options.gradient) ? this._options.gradient : CesiumHeatmap.defaults.gradient);\n\tthis._options.maxOpacity = ((this._options.maxOpacity) ? this._options.maxOpacity : CesiumHeatmap.defaults.maxOpacity);\n\tthis._options.minOpacity = ((this._options.minOpacity) ? this._options.minOpacity : CesiumHeatmap.defaults.minOpacity);\n\tthis._options.blur = ((this._options.blur) ? this._options.blur : CesiumHeatmap.defaults.blur);\n\n\tthis._mbounds = CesiumHeatmap.wgs84ToMercatorBB(bb);\n\tthis._setWidthAndHeight(this._mbounds);\n\n\tthis._options.radius = Math.round((this._options.radius) ? this._options.radius : ((this.width > this.height) ? this.width / CesiumHeatmap.defaults.radiusFactor : this.height / CesiumHeatmap.defaults.radiusFactor));\n\n\tthis._spacing = this._options.radius * CesiumHeatmap.defaults.spacingFactor;\n\tthis._xoffset = this._mbounds.west;\n\tthis._yoffset = this._mbounds.south;\n\n\tthis.width = Math.round(this.width + this._spacing * 2);\n\tthis.height = Math.round(this.height + this._spacing * 2);\n\n\tthis._mbounds.west -= this._spacing * this._factor;\n\tthis._mbounds.east += this._spacing * this._factor;\n\tthis._mbounds.south -= this._spacing * this._factor;\n\tthis._mbounds.north += this._spacing * this._factor;\n\n\tthis.bounds = CesiumHeatmap.mercatorToWgs84BB(this._mbounds);\n\n\tthis._rectangle = Cesium.Rectangle.fromDegrees(this.bounds.west, this.bounds.south, this.bounds.east, this.bounds.north);\n\tthis._container = CesiumHeatmap._getContainer(this.width, this.height, this._id);\n\tthis._options.container = this._container;\n\tthis._heatmap = h337.create(this._options);\n\tthis._container.children[0].setAttribute(\"id\", this._id + \"-hm\");\n}\n\n/* Convert a WGS84 location to the corresponding heatmap location\n *\n * p: a WGS84 location like {x:lon, y:lat}\n */\nCHInstance.prototype.wgs84PointToHeatmapPoint = function (p) {\n\treturn this.mercatorPointToHeatmapPoint(CesiumHeatmap.wgs84ToMercator(p));\n};\n\n/* Convert a mercator location to the corresponding heatmap location\n *\n * p: a WGS84 location like {x: lon, y:lat}\n */\nCHInstance.prototype.mercatorPointToHeatmapPoint = function (p) {\n\tvar pn = {};\n\n\tpn.x = Math.round((p.x - this._xoffset) / this._factor + this._spacing);\n\tpn.y = Math.round((p.y - this._yoffset) / this._factor + this._spacing);\n\tpn.y = this.height - pn.y;\n\n\treturn pn;\n};\n\nCHInstance.prototype._setWidthAndHeight = function (mbb) {\n\tthis.width = ((mbb.east > 0 && mbb.west < 0) ? mbb.east + Math.abs(mbb.west) : Math.abs(mbb.east - mbb.west));\n\tthis.height = ((mbb.north > 0 && mbb.south < 0) ? mbb.north + Math.abs(mbb.south) : Math.abs(mbb.north - mbb.south));\n\tthis._factor = 1;\n\n\tif (this.width > this.height && this.width > CesiumHeatmap.defaults.maxCanvasSize) {\n\t\tthis._factor = this.width / CesiumHeatmap.defaults.maxCanvasSize;\n\n\t\tif (this.height / this._factor < CesiumHeatmap.defaults.minCanvasSize) {\n\t\t\tthis._factor = this.height / CesiumHeatmap.defaults.minCanvasSize;\n\t\t}\n\t} else if (this.height > this.width && this.height > CesiumHeatmap.defaults.maxCanvasSize) {\n\t\tthis._factor = this.height / CesiumHeatmap.defaults.maxCanvasSize;\n\n\t\tif (this.width / this._factor < CesiumHeatmap.defaults.minCanvasSize) {\n\t\t\tthis._factor = this.width / CesiumHeatmap.defaults.minCanvasSize;\n\t\t}\n\t} else if (this.width < this.height && this.width < CesiumHeatmap.defaults.minCanvasSize) {\n\t\tthis._factor = this.width / CesiumHeatmap.defaults.minCanvasSize;\n\n\t\tif (this.height / this._factor > CesiumHeatmap.defaults.maxCanvasSize) {\n\t\t\tthis._factor = this.height / CesiumHeatmap.defaults.maxCanvasSize;\n\t\t}\n\t} else if (this.height < this.width && this.height < CesiumHeatmap.defaults.minCanvasSize) {\n\t\tthis._factor = this.height / CesiumHeatmap.defaults.minCanvasSize;\n\n\t\tif (this.width / this._factor > CesiumHeatmap.defaults.maxCanvasSize) {\n\t\t\tthis._factor = this.width / CesiumHeatmap.defaults.maxCanvasSize;\n\t\t}\n\t}\n\n\tthis.width = this.width / this._factor;\n\tthis.height = this.height / this._factor;\n};\n\n/* Set an array of heatmap locations\n *\n * min: the minimum allowed value for the data values\n * max: the maximum allowed value for the data values\n * data: an array of data points in heatmap coordinates and values like {x, y, value}\n */\nCHInstance.prototype.setData = function (min, max, data) {\n\tif (data && data.length > 0 && min !== null && min !== false && max !== null && max !== false) {\n\t\tthis._heatmap.setData({\n\t\t\tmin: min,\n\t\t\tmax: max,\n\t\t\tdata: data\n\t\t});\n\n\t\tthis.updateLayer();\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\n/* Set an array of WGS84 locations\n *\n * min: the minimum allowed value for the data values\n * max: the maximum allowed value for the data values\n * data: an array of data points in WGS84 coordinates and values like { x:lon, y:lat, value }\n */\nCHInstance.prototype.setWGS84Data = function (min, max, data) {\n\tif (data && data.length > 0 && min !== null && min !== false && max !== null && max !== false) {\n\t\tvar convdata = [];\n\n\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\tvar gp = data[i];\n\n\t\t\tvar hp = this.wgs84PointToHeatmapPoint(gp);\n\t\t\tif (gp.value || gp.value === 0) {\n\t\t\t\thp.value = gp.value;\n\t\t\t}\n\n\t\t\tconvdata.push(hp);\n\t\t}\n\n\t\treturn this.setData(min, max, convdata);\n\t}\n\n\treturn false;\n};\n\n/* Set whether or not the heatmap is shown on the map\n *\n * s: true means the heatmap is shown, false means the heatmap is hidden\n */\nCHInstance.prototype.show = function (s) {\n\tif (this._layer) {\n\t\tthis._layer.show = s;\n\t}\n};\n\n/* Update/(re)draw the heatmap\n */\nCHInstance.prototype.updateLayer = function () {\n\n\t// only works with a Viewer instance since the cesiumWidget\n\t// instance doesn't contain an entities property\n\tif (CesiumHeatmap.defaults.useEntitiesIfAvailable && this._cesium.entities) {\n\t\tif (this._layer) {\n\t\t\tthis._cesium.entities.remove(this._layer);\n\t\t}\n\n\t\t// Work around issue with material rendering in Cesium\n\t\t// provided by https://github.com/criis\n\t\tconst material = new Cesium.ImageMaterialProperty({\n\t\t\timage: this._heatmap._renderer.canvas,\n\t\t});\n\t\tif (Cesium.VERSION >= \"1.21\") {\n\t\t\tmaterial.transparent = true;\n\t\t} else if (Cesium.VERSION >= \"1.16\") {\n\t\t\tmaterial.alpha = 0.99;\n\t\t}\n\n\t\tthis._layer = this._cesium.entities.add({\n\t\t\tshow: true,\n\t\t\trectangle: {\n\t\t\t\tcoordinates: this._rectangle,\n\t\t\t\tmaterial: material\n\t\t\t}\n\t\t});\n\t} else {\n\t\tif (this._layer) {\n\t\t\tthis._cesium.scene.imageryLayers.remove(this._layer);\n\t\t}\n\n\t\tthis._layer = this._cesium.scene.imageryLayers.addImageryProvider(CesiumHeatmap._getImageryProvider(this));\n\t}\n};\n"],"mappings":";;;AAKA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA8B,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAI,GAAA,EAAAG,WAAA,SAAAA,WAAA,IAAAH,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAO,OAAA,CAAAP,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAQ,KAAA,GAAAN,wBAAA,CAAAC,WAAA,OAAAK,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,qBAAA,GAAAC,MAA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