ol 7.1.1-dev.1670506934726 → 7.1.1-dev.1670856617099
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/AssertionError.d.ts.map +1 -1
- package/AssertionError.js +1 -0
- package/package.json +1 -1
- package/style/Icon.d.ts +51 -0
- package/style/Icon.d.ts.map +1 -1
- package/style/Icon.js +119 -0
- package/style/Image.d.ts.map +1 -1
- package/style/Image.js +1 -0
- package/util.js +1 -1
- package/worker/webgl.js +1 -1
package/AssertionError.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssertionError.d.ts","sourceRoot":"","sources":["AssertionError.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AssertionError.d.ts","sourceRoot":"","sources":["AssertionError.js"],"names":[],"mappings":";AAiEA;;;;GAIG;AACH;IACE;;OAEG;IACH,kBAFW,MAAM,EAyBhB;IAlBC;;;;;;;;OAQG;IACH,MAJU,MAAM,CAIA;CAUnB"}
|
package/AssertionError.js
CHANGED
|
@@ -60,6 +60,7 @@ const messages = {
|
|
|
60
60
|
66: '`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`',
|
|
61
61
|
67: 'A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both',
|
|
62
62
|
68: 'A VectorTile source can only be rendered if it has a projection compatible with the view projection',
|
|
63
|
+
69: '`width` or `height` cannot be provided together with `scale`',
|
|
63
64
|
};
|
|
64
65
|
|
|
65
66
|
/**
|
package/package.json
CHANGED
package/style/Icon.d.ts
CHANGED
|
@@ -60,6 +60,14 @@ export type Options = {
|
|
|
60
60
|
* Opacity of the icon.
|
|
61
61
|
*/
|
|
62
62
|
opacity?: number | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* The width of the icon in pixels. This can't be used together with `scale`.
|
|
65
|
+
*/
|
|
66
|
+
width?: number | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* The height of the icon in pixels. This can't be used together with `scale`.
|
|
69
|
+
*/
|
|
70
|
+
height?: number | undefined;
|
|
63
71
|
/**
|
|
64
72
|
* Scale.
|
|
65
73
|
*/
|
|
@@ -128,6 +136,8 @@ export type Options = {
|
|
|
128
136
|
* @property {Array<number>} [displacement=[0, 0]] Displacement of the icon in pixels.
|
|
129
137
|
* Positive values will shift the icon right and up.
|
|
130
138
|
* @property {number} [opacity=1] Opacity of the icon.
|
|
139
|
+
* @property {number} [width] The width of the icon in pixels. This can't be used together with `scale`.
|
|
140
|
+
* @property {number} [height] The height of the icon in pixels. This can't be used together with `scale`.
|
|
131
141
|
* @property {number|import("../size.js").Size} [scale=1] Scale.
|
|
132
142
|
* @property {boolean} [rotateWithView=false] Whether to rotate the icon with the view.
|
|
133
143
|
* @property {number} [rotation=0] Rotation in radians (positive rotation clockwise).
|
|
@@ -215,12 +225,29 @@ declare class Icon extends ImageStyle {
|
|
|
215
225
|
* @type {import("../size.js").Size}
|
|
216
226
|
*/
|
|
217
227
|
private size_;
|
|
228
|
+
/**
|
|
229
|
+
* @type {number|undefined}
|
|
230
|
+
*/
|
|
231
|
+
width_: number | undefined;
|
|
232
|
+
/**
|
|
233
|
+
* @type {number|undefined}
|
|
234
|
+
*/
|
|
235
|
+
height_: number | undefined;
|
|
218
236
|
/**
|
|
219
237
|
* Clones the style. The underlying Image/HTMLCanvasElement is not cloned.
|
|
220
238
|
* @return {Icon} The cloned style.
|
|
221
239
|
* @api
|
|
222
240
|
*/
|
|
223
241
|
clone(): Icon;
|
|
242
|
+
/**
|
|
243
|
+
* Set the scale of the Icon by calculating it from given width and height and the
|
|
244
|
+
* width and height of the image.
|
|
245
|
+
*
|
|
246
|
+
* @private
|
|
247
|
+
* @param {number} width The width.
|
|
248
|
+
* @param {number} height The height.
|
|
249
|
+
*/
|
|
250
|
+
private updateScaleFromWidthAndHeight;
|
|
224
251
|
/**
|
|
225
252
|
* Set the anchor point. The anchor determines the center point for the
|
|
226
253
|
* symbolizer.
|
|
@@ -252,6 +279,30 @@ declare class Icon extends ImageStyle {
|
|
|
252
279
|
* @api
|
|
253
280
|
*/
|
|
254
281
|
getSrc(): string | undefined;
|
|
282
|
+
/**
|
|
283
|
+
* Get the width of the icon (in pixels).
|
|
284
|
+
* @return {number} Icon width (in pixels).
|
|
285
|
+
* @api
|
|
286
|
+
*/
|
|
287
|
+
getWidth(): number;
|
|
288
|
+
/**
|
|
289
|
+
* Get the height of the icon (in pixels).
|
|
290
|
+
* @return {number} Icon height (in pixels).
|
|
291
|
+
* @api
|
|
292
|
+
*/
|
|
293
|
+
getHeight(): number;
|
|
294
|
+
/**
|
|
295
|
+
* Set the width of the icon in pixels.
|
|
296
|
+
*
|
|
297
|
+
* @param {number} width The width to set.
|
|
298
|
+
*/
|
|
299
|
+
setWidth(width: number): void;
|
|
300
|
+
/**
|
|
301
|
+
* Set the height of the icon in pixels.
|
|
302
|
+
*
|
|
303
|
+
* @param {number} height The height to set.
|
|
304
|
+
*/
|
|
305
|
+
setHeight(height: number): void;
|
|
255
306
|
}
|
|
256
307
|
import ImageStyle from "./Image.js";
|
|
257
308
|
//# sourceMappingURL=Icon.d.ts.map
|
package/style/Icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["Icon.js"],"names":[],"mappings":";;;;8BAYa,UAAU,GAAG,QAAQ;;;;yBAKrB,aAAa,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["Icon.js"],"names":[],"mappings":";;;;8BAYa,UAAU,GAAG,QAAQ;;;;yBAKrB,aAAa,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAwCxD,WAAW,GAAC,UAAU,GAAC,MAAM,GAAC,SAAS;;AA9CrD;;;GAGG;AAEH;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH;;;;GAIG;AACH;IACE;;OAEG;IACH,2CAoLC;IAlJC;;;OAGG;IACH,gBAAyE;IAEzE;;;OAGG;IACH,0BAA6B;IAE7B;;;OAGG;IACH,sBACwE;IAExE;;;OAGG;IACH,sBACwE;IAExE;;;OAGG;IACH,sBACwE;IAExE;;;OAGG;IACH,qBACgE;IAOhE;;;OAGG;IACH,iBAA+B;IA8B/B;;;OAGG;IACH,eAAyE;IAEzE;;;OAGG;IACH,mBAOC;IAED;;;OAGG;IACH,gBAAqE;IACrE;;;OAGG;IACH,sBACwE;IAExE;;;OAGG;IACH,gBAAmB;IAEnB;;;OAGG;IACH,cAA6D;IAE7D;;OAEG;IACH,QAFU,MAAM,GAAC,SAAS,CAEC;IAE3B;;OAEG;IACH,SAFU,MAAM,GAAC,SAAS,CAEG;IAkB/B;;;;OAIG;IACH,SAHY,IAAI,CA6Bf;IAED;;;;;;;OAOG;IACH,sCAWC;IA6DD;;;;;;OAMG;IACH,kBAHW,MAAM,MAAM,CAAC,QAMvB;IAED;;;;OAIG;IACH,YAHY,OAAO,aAAa,EAAE,KAAK,CAKtC;IAED;;;;;OAKG;IACH,qBAJW,MAAM,GACL,gBAAgB,GAAC,iBAAiB,CAK7C;IA0BD;;OAEG;IACH,wBAFY,gBAAgB,GAAC,iBAAiB,CAI7C;IAqCD;;;;OAIG;IACH,UAHY,MAAM,GAAC,SAAS,CAK3B;IAWD;;;;OAIG;IACH,YAHY,MAAM,CAKjB;IAED;;;;OAIG;IACH,aAHY,MAAM,CAKjB;IAED;;;;OAIG;IACH,gBAFW,MAAM,QAKhB;IAED;;;;OAIG;IACH,kBAFW,MAAM,QAKhB;CAgDF"}
|
package/style/Icon.js
CHANGED
|
@@ -43,6 +43,8 @@ import {getUid} from '../util.js';
|
|
|
43
43
|
* @property {Array<number>} [displacement=[0, 0]] Displacement of the icon in pixels.
|
|
44
44
|
* Positive values will shift the icon right and up.
|
|
45
45
|
* @property {number} [opacity=1] Opacity of the icon.
|
|
46
|
+
* @property {number} [width] The width of the icon in pixels. This can't be used together with `scale`.
|
|
47
|
+
* @property {number} [height] The height of the icon in pixels. This can't be used together with `scale`.
|
|
46
48
|
* @property {number|import("../size.js").Size} [scale=1] Scale.
|
|
47
49
|
* @property {boolean} [rotateWithView=false] Whether to rotate the icon with the view.
|
|
48
50
|
* @property {number} [rotation=0] Rotation in radians (positive rotation clockwise).
|
|
@@ -163,6 +165,15 @@ class Icon extends ImageStyle {
|
|
|
163
165
|
}
|
|
164
166
|
assert(src !== undefined && src.length > 0, 6); // A defined and non-empty `src` or `image` must be provided
|
|
165
167
|
|
|
168
|
+
// `width` or `height` cannot be provided together with `scale`
|
|
169
|
+
assert(
|
|
170
|
+
!(
|
|
171
|
+
(options.width !== undefined || options.height !== undefined) &&
|
|
172
|
+
options.scale !== undefined
|
|
173
|
+
),
|
|
174
|
+
69
|
|
175
|
+
);
|
|
176
|
+
|
|
166
177
|
/**
|
|
167
178
|
* @type {import("../ImageState.js").default}
|
|
168
179
|
*/
|
|
@@ -211,6 +222,31 @@ class Icon extends ImageStyle {
|
|
|
211
222
|
* @type {import("../size.js").Size}
|
|
212
223
|
*/
|
|
213
224
|
this.size_ = options.size !== undefined ? options.size : null;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @type {number|undefined}
|
|
228
|
+
*/
|
|
229
|
+
this.width_ = options.width;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @type {number|undefined}
|
|
233
|
+
*/
|
|
234
|
+
this.height_ = options.height;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Recalculate the scale if width or height where given.
|
|
238
|
+
*/
|
|
239
|
+
if (this.width_ !== undefined || this.height_ !== undefined) {
|
|
240
|
+
const image = this.getImage(1);
|
|
241
|
+
const setScale = () => {
|
|
242
|
+
this.updateScaleFromWidthAndHeight(this.width_, this.height_);
|
|
243
|
+
};
|
|
244
|
+
if (image.width > 0) {
|
|
245
|
+
this.updateScaleFromWidthAndHeight(this.width_, this.height_);
|
|
246
|
+
} else {
|
|
247
|
+
image.addEventListener('load', setScale);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
214
250
|
}
|
|
215
251
|
|
|
216
252
|
/**
|
|
@@ -241,9 +277,32 @@ class Icon extends ImageStyle {
|
|
|
241
277
|
src: this.getSrc(),
|
|
242
278
|
displacement: this.getDisplacement().slice(),
|
|
243
279
|
declutterMode: this.getDeclutterMode(),
|
|
280
|
+
width: this.width_,
|
|
281
|
+
height: this.height_,
|
|
244
282
|
});
|
|
245
283
|
}
|
|
246
284
|
|
|
285
|
+
/**
|
|
286
|
+
* Set the scale of the Icon by calculating it from given width and height and the
|
|
287
|
+
* width and height of the image.
|
|
288
|
+
*
|
|
289
|
+
* @private
|
|
290
|
+
* @param {number} width The width.
|
|
291
|
+
* @param {number} height The height.
|
|
292
|
+
*/
|
|
293
|
+
updateScaleFromWidthAndHeight(width, height) {
|
|
294
|
+
const image = this.getImage(1);
|
|
295
|
+
if (width !== undefined && height !== undefined) {
|
|
296
|
+
super.setScale([width / image.width, height / image.height]);
|
|
297
|
+
} else if (width !== undefined) {
|
|
298
|
+
super.setScale([width / image.width, width / image.width]);
|
|
299
|
+
} else if (height !== undefined) {
|
|
300
|
+
super.setScale([height / image.height, height / image.height]);
|
|
301
|
+
} else {
|
|
302
|
+
super.setScale([1, 1]);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
247
306
|
/**
|
|
248
307
|
* Get the anchor point in pixels. The anchor determines the center point for the
|
|
249
308
|
* symbolizer.
|
|
@@ -418,6 +477,66 @@ class Icon extends ImageStyle {
|
|
|
418
477
|
return !this.size_ ? this.iconImage_.getSize() : this.size_;
|
|
419
478
|
}
|
|
420
479
|
|
|
480
|
+
/**
|
|
481
|
+
* Get the width of the icon (in pixels).
|
|
482
|
+
* @return {number} Icon width (in pixels).
|
|
483
|
+
* @api
|
|
484
|
+
*/
|
|
485
|
+
getWidth() {
|
|
486
|
+
return this.width_;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Get the height of the icon (in pixels).
|
|
491
|
+
* @return {number} Icon height (in pixels).
|
|
492
|
+
* @api
|
|
493
|
+
*/
|
|
494
|
+
getHeight() {
|
|
495
|
+
return this.height_;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Set the width of the icon in pixels.
|
|
500
|
+
*
|
|
501
|
+
* @param {number} width The width to set.
|
|
502
|
+
*/
|
|
503
|
+
setWidth(width) {
|
|
504
|
+
this.width_ = width;
|
|
505
|
+
this.updateScaleFromWidthAndHeight(width, this.height_);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Set the height of the icon in pixels.
|
|
510
|
+
*
|
|
511
|
+
* @param {number} height The height to set.
|
|
512
|
+
*/
|
|
513
|
+
setHeight(height) {
|
|
514
|
+
this.height_ = height;
|
|
515
|
+
this.updateScaleFromWidthAndHeight(this.width_, height);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Set the scale and updates the width and height correspondingly.
|
|
520
|
+
*
|
|
521
|
+
* @param {number|import("../size.js").Size} scale Scale.
|
|
522
|
+
* @override
|
|
523
|
+
* @api
|
|
524
|
+
*/
|
|
525
|
+
setScale(scale) {
|
|
526
|
+
super.setScale(scale);
|
|
527
|
+
const image = this.getImage(1);
|
|
528
|
+
if (image) {
|
|
529
|
+
const widthScale = Array.isArray(scale) ? scale[0] : scale;
|
|
530
|
+
if (widthScale !== undefined) {
|
|
531
|
+
this.width_ = widthScale * image.width;
|
|
532
|
+
}
|
|
533
|
+
const heightScale = Array.isArray(scale) ? scale[1] : scale;
|
|
534
|
+
if (heightScale !== undefined) {
|
|
535
|
+
this.height_ = heightScale * image.height;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
421
540
|
/**
|
|
422
541
|
* @param {function(import("../events/Event.js").default): void} listener Listener function.
|
|
423
542
|
*/
|
package/style/Image.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["Image.js"],"names":[],"mappings":";;;;;aAQc,MAAM;;;;oBACN,OAAO;;;;cACP,MAAM;;;;WACN,MAAM,GAAC,OAAO,YAAY,EAAE,IAAI;;;;kBAChC,MAAM,MAAM,CAAC;;;;mBACb,WAAW,GAAC,UAAU,GAAC,MAAM,GAAC,SAAS;;AAPrD;;;;;;;sHAOsH;AAEtH;;;;;;;GAOG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EA4CjB;IAzCC;;;OAGG;IACH,iBAA+B;IAE/B;;;OAGG;IACH,wBAA6C;IAE7C;;;OAGG;IACH,kBAAiC;IAEjC;;;OAGG;IACH,eAA2B;IAE3B;;;OAGG;IACH,oBAAwC;IAExC;;;OAGG;IACH,sBAAyC;IAEzC;;;OAGG;IACH,uBAA2C;IAG7C;;;;OAIG;IACH,SAHY,UAAU,CAarB;IAED;;;;OAIG;IACH,cAHY,MAAM,CAKjB;IAED;;;;OAIG;IACH,qBAHY,OAAO,CAKlB;IAED;;;;OAIG;IACH,eAHY,MAAM,CAKjB;IAED;;;;OAIG;IACH,YAHY,MAAM,GAAC,OAAO,YAAY,EAAE,IAAI,CAK3C;IAED;;;OAGG;IACH,iBAFY,OAAO,YAAY,EAAE,IAAI,CAIpC;IAED;;;;OAIG;IACH,mBAHY,MAAM,MAAM,CAAC,CAKxB;IAED;;;;OAIG;IACH,oBAHY,WAAW,GAAC,UAAU,GAAC,MAAM,GAAC,SAAS,CAKlD;IAED;;;;;OAKG;IACH,aAFY,MAAM,MAAM,CAAC,CAIxB;IAED;;;;;OAKG;IACH,qBAHW,MAAM,GACL,iBAAiB,GAAC,gBAAgB,GAAC,gBAAgB,CAI9D;IAED;;;OAGG;IACH,wBAFY,iBAAiB,GAAC,gBAAgB,GAAC,gBAAgB,CAI9D;IAED;;;;OAIG;IACH,0BAHW,MAAM,GACL,MAAM,CAIjB;IAED;;;OAGG;IACH,qBAEC;IAED;;;OAGG;IACH,gBAFY,OAAO,YAAY,EAAE,IAAI,CAIpC;IAED;;;;OAIG;IACH,aAFY,MAAM,MAAM,CAAC,CAIxB;IAED;;;;OAIG;IACH,WAFY,OAAO,YAAY,EAAE,IAAI,CAIpC;IAED;;;;;OAKG;IACH,8BAHW,MAAM,MAAM,CAAC,QAKvB;IAED;;;;;OAKG;IACH,oBAHW,MAAM,QAKhB;IAED;;;;;OAKG;IACH,kCAHW,OAAO,QAKjB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,QAKhB;
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["Image.js"],"names":[],"mappings":";;;;;aAQc,MAAM;;;;oBACN,OAAO;;;;cACP,MAAM;;;;WACN,MAAM,GAAC,OAAO,YAAY,EAAE,IAAI;;;;kBAChC,MAAM,MAAM,CAAC;;;;mBACb,WAAW,GAAC,UAAU,GAAC,MAAM,GAAC,SAAS;;AAPrD;;;;;;;sHAOsH;AAEtH;;;;;;;GAOG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EA4CjB;IAzCC;;;OAGG;IACH,iBAA+B;IAE/B;;;OAGG;IACH,wBAA6C;IAE7C;;;OAGG;IACH,kBAAiC;IAEjC;;;OAGG;IACH,eAA2B;IAE3B;;;OAGG;IACH,oBAAwC;IAExC;;;OAGG;IACH,sBAAyC;IAEzC;;;OAGG;IACH,uBAA2C;IAG7C;;;;OAIG;IACH,SAHY,UAAU,CAarB;IAED;;;;OAIG;IACH,cAHY,MAAM,CAKjB;IAED;;;;OAIG;IACH,qBAHY,OAAO,CAKlB;IAED;;;;OAIG;IACH,eAHY,MAAM,CAKjB;IAED;;;;OAIG;IACH,YAHY,MAAM,GAAC,OAAO,YAAY,EAAE,IAAI,CAK3C;IAED;;;OAGG;IACH,iBAFY,OAAO,YAAY,EAAE,IAAI,CAIpC;IAED;;;;OAIG;IACH,mBAHY,MAAM,MAAM,CAAC,CAKxB;IAED;;;;OAIG;IACH,oBAHY,WAAW,GAAC,UAAU,GAAC,MAAM,GAAC,SAAS,CAKlD;IAED;;;;;OAKG;IACH,aAFY,MAAM,MAAM,CAAC,CAIxB;IAED;;;;;OAKG;IACH,qBAHW,MAAM,GACL,iBAAiB,GAAC,gBAAgB,GAAC,gBAAgB,CAI9D;IAED;;;OAGG;IACH,wBAFY,iBAAiB,GAAC,gBAAgB,GAAC,gBAAgB,CAI9D;IAED;;;;OAIG;IACH,0BAHW,MAAM,GACL,MAAM,CAIjB;IAED;;;OAGG;IACH,qBAEC;IAED;;;OAGG;IACH,gBAFY,OAAO,YAAY,EAAE,IAAI,CAIpC;IAED;;;;OAIG;IACH,aAFY,MAAM,MAAM,CAAC,CAIxB;IAED;;;;OAIG;IACH,WAFY,OAAO,YAAY,EAAE,IAAI,CAIpC;IAED;;;;;OAKG;IACH,8BAHW,MAAM,MAAM,CAAC,QAKvB;IAED;;;;;OAKG;IACH,oBAHW,MAAM,QAKhB;IAED;;;;;OAKG;IACH,kCAHW,OAAO,QAKjB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,QAKhB;IAED;;;;;OAKG;IACH,gBAHW,MAAM,GAAC,OAAO,YAAY,EAAE,IAAI,QAM1C;IAED;;;OAGG;IACH,mCAFoB,OAAO,oBAAoB,EAAE,OAAO,KAAG,IAAI,QAI9D;IAED;;;OAGG;IACH,aAEC;IAED;;;OAGG;IACH,qCAFoB,OAAO,oBAAoB,EAAE,OAAO,KAAG,IAAI,QAI9D;CACF"}
|
package/style/Image.js
CHANGED
package/util.js
CHANGED
package/worker/webgl.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
export function create() {
|
|
3
|
-
const source = "const e=\"GENERATE_POLYGON_BUFFERS\",t=\"GENERATE_POINT_BUFFERS\",n=\"GENERATE_LINE_STRING_BUFFERS\",r={1:\"The view center is not defined\",2:\"The view resolution is not defined\",3:\"The view rotation is not defined\",4:\"`image` and `src` cannot be provided at the same time\",5:\"`imgSize` must be set when `image` is provided\",7:\"`format` must be set when `url` is set\",8:\"Unknown `serverType` configured\",9:\"`url` must be configured or set using `#setUrl()`\",10:\"The default `geometryFunction` can only handle `Point` geometries\",11:\"`options.featureTypes` must be an Array\",12:\"`options.geometryName` must also be provided when `options.bbox` is set\",13:\"Invalid corner\",14:\"Invalid color\",15:\"Tried to get a value for a key that does not exist in the cache\",16:\"Tried to set a value for a key that is used already\",17:\"`resolutions` must be sorted in descending order\",18:\"Either `origin` or `origins` must be configured, never both\",19:\"Number of `tileSizes` and `resolutions` must be equal\",20:\"Number of `origins` and `resolutions` must be equal\",22:\"Either `tileSize` or `tileSizes` must be configured, never both\",24:\"Invalid extent or geometry provided as `geometry`\",25:\"Cannot fit empty extent provided as `geometry`\",26:\"Features must have an id set\",27:\"Features must have an id set\",28:'`renderMode` must be `\"hybrid\"` or `\"vector\"`',30:\"The passed `feature` was already added to the source\",31:\"Tried to enqueue an `element` that was already added to the queue\",32:\"Transformation matrix cannot be inverted\",33:\"Invalid units\",34:\"Invalid geometry layout\",36:\"Unknown SRS type\",37:\"Unknown geometry type found\",38:\"`styleMapValue` has an unknown type\",39:\"Unknown geometry type\",40:\"Expected `feature` to have a geometry\",41:\"Expected an `ol/style/Style` or an array of `ol/style/Style.js`\",42:\"Question unknown, the answer is 42\",43:\"Expected `layers` to be an array or a `Collection`\",47:\"Expected `controls` to be an array or an `ol/Collection`\",48:\"Expected `interactions` to be an array or an `ol/Collection`\",49:\"Expected `overlays` to be an array or an `ol/Collection`\",50:\"`options.featureTypes` should be an Array\",51:\"Either `url` or `tileJSON` options must be provided\",52:\"Unknown `serverType` configured\",53:\"Unknown `tierSizeCalculation` configured\",55:\"The {-y} placeholder requires a tile grid with extent\",56:\"mapBrowserEvent must originate from a pointer event\",57:\"At least 2 conditions are required\",59:\"Invalid command found in the PBF\",60:\"Missing or invalid `size`\",61:\"Cannot determine IIIF Image API version from provided image information JSON\",62:\"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`\",64:\"Layer opacity must be a number\",66:\"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`\",67:\"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both\",68:\"A VectorTile source can only be rendered if it has a projection compatible with the view projection\"};class o extends Error{constructor(e){const t=r[e];super(t),this.code=e,this.name=\"AssertionError\",this.message=t}}var i=o;function a(e,t){const n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function s(e,t){const n=(r=t)[0]*r[3]-r[1]*r[2];var r;!function(e,t){if(!e)throw new i(t)}(0!==n,32);const o=t[0],a=t[1],s=t[2],u=t[3],x=t[4],f=t[5];return e[0]=u/n,e[1]=-a/n,e[2]=-s/n,e[3]=o/n,e[4]=(s*f-u*x)/n,e[5]=-(o*f-a*x)/n,e}new Array(6);var u={exports:{}};function x(e,t,n){n=n||2;var r,o,i,a,s,u,x,l=t&&t.length,c=l?t[0]*n:e.length,v=f(e,0,c,n,!0),d=[];if(!v||v.next===v.prev)return d;if(l&&(v=function(e,t,n,r){var o,i,a,s=[];for(o=0,i=t.length;o<i;o++)(a=f(e,t[o]*r,o<i-1?t[o+1]*r:e.length,r,!1))===a.next&&(a.steiner=!0),s.push(w(a));for(s.sort(p),o=0;o<s.length;o++)n=b(s[o],n);return n}(e,t,v,n)),e.length>80*n){r=i=e[0],o=a=e[1];for(var y=n;y<c;y+=n)(s=e[y])<r&&(r=s),(u=e[y+1])<o&&(o=u),s>i&&(i=s),u>a&&(a=u);x=0!==(x=Math.max(i-r,a-o))?32767/x:0}return h(v,d,n,r,o,x,0),d}function f(e,t,n,r,o){var i,a;if(o===B(e,t,n,r)>0)for(i=t;i<n;i+=r)a=k(i,e[i],e[i+1],a);else for(i=n-r;i>=t;i-=r)a=k(i,e[i],e[i+1],a);return a&&M(a,a.next)&&(z(a),a=a.next),a}function l(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!M(r,r.next)&&0!==Z(r.prev,r,r.next))r=r.next;else{if(z(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function h(e,t,n,r,o,i,a){if(e){!a&&i&&function(e,t,n,r){var o=e;do{0===o.z&&(o.z=g(o.x,o.y,t,n,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var t,n,r,o,i,a,s,u,x=1;do{for(n=e,e=null,i=null,a=0;n;){for(a++,r=n,s=0,t=0;t<x&&(s++,r=r.nextZ);t++);for(u=x;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(o=n,n=n.nextZ,s--):(o=r,r=r.nextZ,u--),i?i.nextZ=o:e=o,o.prevZ=i,i=o;n=r}i.nextZ=null,x*=2}while(a>1)}(o)}(e,r,o,i);for(var s,u,x=e;e.prev!==e.next;)if(s=e.prev,u=e.next,i?v(e,r,o,i):c(e))t.push(s.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),z(e),e=u.next,x=u.next;else if((e=u)===x){a?1===a?h(e=d(l(e),t,n),t,n,r,o,i,2):2===a&&y(e,t,n,r,o,i):h(l(e),t,n,r,o,i,1);break}}}function c(e){var t=e.prev,n=e,r=e.next;if(Z(t,n,r)>=0)return!1;for(var o=t.x,i=n.x,a=r.x,s=t.y,u=n.y,x=r.y,f=o<i?o<a?o:a:i<a?i:a,l=s<u?s<x?s:x:u<x?u:x,h=o>i?o>a?o:a:i>a?i:a,c=s>u?s>x?s:x:u>x?u:x,v=r.next;v!==t;){if(v.x>=f&&v.x<=h&&v.y>=l&&v.y<=c&&A(o,s,i,u,a,x,v.x,v.y)&&Z(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function v(e,t,n,r){var o=e.prev,i=e,a=e.next;if(Z(o,i,a)>=0)return!1;for(var s=o.x,u=i.x,x=a.x,f=o.y,l=i.y,h=a.y,c=s<u?s<x?s:x:u<x?u:x,v=f<l?f<h?f:h:l<h?l:h,d=s>u?s>x?s:x:u>x?u:x,y=f>l?f>h?f:h:l>h?l:h,p=g(c,v,t,n,r),b=g(d,y,t,n,r),m=e.prevZ,w=e.nextZ;m&&m.z>=p&&w&&w.z<=b;){if(m.x>=c&&m.x<=d&&m.y>=v&&m.y<=y&&m!==o&&m!==a&&A(s,f,u,l,x,h,m.x,m.y)&&Z(m.prev,m,m.next)>=0)return!1;if(m=m.prevZ,w.x>=c&&w.x<=d&&w.y>=v&&w.y<=y&&w!==o&&w!==a&&A(s,f,u,l,x,h,w.x,w.y)&&Z(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;m&&m.z>=p;){if(m.x>=c&&m.x<=d&&m.y>=v&&m.y<=y&&m!==o&&m!==a&&A(s,f,u,l,x,h,m.x,m.y)&&Z(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;w&&w.z<=b;){if(w.x>=c&&w.x<=d&&w.y>=v&&w.y<=y&&w!==o&&w!==a&&A(s,f,u,l,x,h,w.x,w.y)&&Z(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function d(e,t,n){var r=e;do{var o=r.prev,i=r.next.next;!M(o,i)&&F(o,r,r.next,i)&&S(o,i)&&S(i,o)&&(t.push(o.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),z(r),z(r.next),r=e=i),r=r.next}while(r!==e);return l(r)}function y(e,t,n,r,o,i){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&E(a,s)){var u=U(a,s);return a=l(a,a.next),u=l(u,u.next),h(a,t,n,r,o,i,0),void h(u,t,n,r,o,i,0)}s=s.next}a=a.next}while(a!==e)}function p(e,t){return e.x-t.x}function b(e,t){var n=function(e,t){var n,r=t,o=e.x,i=e.y,a=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=o&&s>a&&(a=s,n=r.x<r.next.x?r:r.next,s===o))return n}r=r.next}while(r!==t);if(!n)return null;var u,x=n,f=n.x,l=n.y,h=1/0;r=n;do{o>=r.x&&r.x>=f&&o!==r.x&&A(i<l?o:a,i,f,l,i<l?a:o,i,r.x,r.y)&&(u=Math.abs(i-r.y)/(o-r.x),S(r,e)&&(u<h||u===h&&(r.x>n.x||r.x===n.x&&m(n,r)))&&(n=r,h=u)),r=r.next}while(r!==x);return n}(e,t);if(!n)return t;var r=U(n,e);return l(r,r.next),l(n,n.next)}function m(e,t){return Z(e.prev,e,t.prev)<0&&Z(t.next,e,e.next)<0}function g(e,t,n,r,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function w(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function A(e,t,n,r,o,i,a,s){return(o-a)*(t-s)>=(e-a)*(i-s)&&(e-a)*(r-s)>=(n-a)*(t-s)&&(n-a)*(i-s)>=(o-a)*(r-s)}function E(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&F(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(S(e,t)&&S(t,e)&&function(e,t){var n=e,r=!1,o=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&o<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Z(e.prev,e,t.prev)||Z(e,t.prev,t))||M(e,t)&&Z(e.prev,e,e.next)>0&&Z(t.prev,t,t.next)>0)}function Z(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function M(e,t){return e.x===t.x&&e.y===t.y}function F(e,t,n,r){var o=I(Z(e,t,n)),i=I(Z(e,t,r)),a=I(Z(n,r,e)),s=I(Z(n,r,t));return o!==i&&a!==s||(!(0!==o||!T(e,n,t))||(!(0!==i||!T(e,r,t))||(!(0!==a||!T(n,e,r))||!(0!==s||!T(n,t,r)))))}function T(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function I(e){return e>0?1:e<0?-1:0}function S(e,t){return Z(e.prev,e,e.next)<0?Z(e,t,e.next)>=0&&Z(e,e.prev,t)>=0:Z(e,t,e.prev)<0||Z(e,e.next,t)<0}function U(e,t){var n=new R(e.i,e.x,e.y),r=new R(t.i,t.x,t.y),o=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function k(e,t,n,r){var o=new R(e,t,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function z(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function R(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function B(e,t,n,r){for(var o=0,i=t,a=n-r;i<n;i+=r)o+=(e[a]-e[i])*(e[i+1]+e[a+1]),a=i;return o}u.exports=x,u.exports.default=x,x.deviation=function(e,t,n,r){var o=t&&t.length,i=o?t[0]*n:e.length,a=Math.abs(B(e,0,i,n));if(o)for(var s=0,u=t.length;s<u;s++){var x=t[s]*n,f=s<u-1?t[s+1]*n:e.length;a-=Math.abs(B(e,x,f,n))}var l=0;for(s=0;s<r.length;s+=3){var h=r[s]*n,c=r[s+1]*n,v=r[s+2]*n;l+=Math.abs((e[h]-e[v])*(e[c+1]-e[h+1])-(e[h]-e[c])*(e[v+1]-e[h+1]))}return 0===a&&0===l?0:Math.abs((l-a)/a)},x.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,o=0;o<e.length;o++){for(var i=0;i<e[o].length;i++)for(var a=0;a<t;a++)n.vertices.push(e[o][i][a]);o>0&&(r+=e[o-1].length,n.holes.push(r))}return n};const N=[],P={vertexPosition:0,indexPosition:0};function C(e,t,n,r,o){e[t+0]=n,e[t+1]=r,e[t+2]=o}function _(e,t,n,r,o,i){const a=3+o,s=e[t+0],u=e[t+1],x=N;x.length=o;for(let n=0;n<x.length;n++)x[n]=e[t+2+n];let f=i?i.vertexPosition:0,l=i?i.indexPosition:0;const h=f/a;return C(n,f,s,u,0),x.length&&n.set(x,f+3),f+=a,C(n,f,s,u,1),x.length&&n.set(x,f+3),f+=a,C(n,f,s,u,2),x.length&&n.set(x,f+3),f+=a,C(n,f,s,u,3),x.length&&n.set(x,f+3),f+=a,r[l++]=h,r[l++]=h+1,r[l++]=h+3,r[l++]=h+1,r[l++]=h+2,r[l++]=h+3,P.vertexPosition=f,P.indexPosition=l,P}function q(e,t,n,r,o,i,s,u,x,f){const l=5+u.length,h=i.length/l,c=[e[t+0],e[t+1]],v=[e[n],e[n+1]],d=a(f,[...c]),y=a(f,[...v]);function p(e,t,n){const r=1e4;return Math.round(1500*t)+Math.round(1500*n)*r+e*r*r}function b(e,t,n){const r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),o=[(t[0]-e[0])/r,(t[1]-e[1])/r],i=[-o[1],o[0]],a=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),s=[(n[0]-e[0])/a,(n[1]-e[1])/a],u=0===r||0===a?0:Math.acos((x=s[0]*o[0]+s[1]*o[1],f=-1,l=1,Math.min(Math.max(x,f),l)));var x,f,l;return s[0]*i[0]+s[1]*i[1]>0?u:2*Math.PI-u}const m=null!==o;let g=0,w=0;if(null!==r){g=b(d,y,a(f,[...[e[r],e[r+1]]]))}if(m){w=b(y,d,a(f,[...[e[o],e[o+1]]]))}i.push(c[0],c[1],v[0],v[1],p(0,g,w)),i.push(...u),i.push(c[0],c[1],v[0],v[1],p(1,g,w)),i.push(...u),i.push(c[0],c[1],v[0],v[1],p(2,g,w)),i.push(...u),i.push(c[0],c[1],v[0],v[1],p(3,g,w)),i.push(...u),s.push(h,h+1,h+2,h+1,h+3,h+2)}function L(e,t,n,r,o){const i=2+o;let a=t;const s=e.slice(a,a+o);a+=o;const x=e[a++];let f=0;const l=new Array(x-1);for(let t=0;t<x;t++)f+=e[a++],t<x-1&&(l[t]=f);const h=e.slice(a,a+2*f),c=u.exports(h,l,2);for(let e=0;e<c.length;e++)r.push(c[e]+n.length/i);for(let e=0;e<h.length;e+=2)n.push(h[e],h[e+1],...s);return a+2*f}const G=self;G.onmessage=r=>{const o=r.data;switch(o.type){case t:{const e=3,t=2,n=o.customAttributesCount,r=t+n,i=new Float32Array(o.renderInstructions),a=i.length/r,s=4*a*(n+e),u=new Uint32Array(6*a),x=new Float32Array(s);let f;for(let e=0;e<i.length;e+=r)f=_(i,e,x,u,n,f);const l=Object.assign({vertexBuffer:x.buffer,indexBuffer:u.buffer,renderInstructions:i.buffer},o);G.postMessage(l,[x.buffer,u.buffer,i.buffer]);break}case n:{const e=[],t=[],n=o.customAttributesCount,r=2,i=new Float32Array(o.renderInstructions);let a=0;const u=o.renderInstructionsTransform,x=[1,0,0,1,0,0];let f,l;for(s(x,u);a<i.length;){l=Array.from(i.slice(a,a+n)),a+=n,f=i[a++];for(let n=0;n<f-1;n++)q(i,a+n*r,a+(n+1)*r,n>0?a+(n-1)*r:null,n<f-2?a+(n+2)*r:null,e,t,l,0,x);a+=f*r}const h=Uint32Array.from(t),c=Float32Array.from(e),v=Object.assign({vertexBuffer:c.buffer,indexBuffer:h.buffer,renderInstructions:i.buffer},o);G.postMessage(v,[c.buffer,h.buffer,i.buffer]);break}case e:{const e=[],t=[],n=o.customAttributesCount,r=new Float32Array(o.renderInstructions);let i=0;for(;i<r.length;)i=L(r,i,e,t,n);const a=Uint32Array.from(t),s=Float32Array.from(e),u=Object.assign({vertexBuffer:s.buffer,indexBuffer:a.buffer,renderInstructions:r.buffer},o);G.postMessage(u,[s.buffer,a.buffer,r.buffer]);break}}};";
|
|
3
|
+
const source = "const e=\"GENERATE_POLYGON_BUFFERS\",t=\"GENERATE_POINT_BUFFERS\",n=\"GENERATE_LINE_STRING_BUFFERS\",r={1:\"The view center is not defined\",2:\"The view resolution is not defined\",3:\"The view rotation is not defined\",4:\"`image` and `src` cannot be provided at the same time\",5:\"`imgSize` must be set when `image` is provided\",7:\"`format` must be set when `url` is set\",8:\"Unknown `serverType` configured\",9:\"`url` must be configured or set using `#setUrl()`\",10:\"The default `geometryFunction` can only handle `Point` geometries\",11:\"`options.featureTypes` must be an Array\",12:\"`options.geometryName` must also be provided when `options.bbox` is set\",13:\"Invalid corner\",14:\"Invalid color\",15:\"Tried to get a value for a key that does not exist in the cache\",16:\"Tried to set a value for a key that is used already\",17:\"`resolutions` must be sorted in descending order\",18:\"Either `origin` or `origins` must be configured, never both\",19:\"Number of `tileSizes` and `resolutions` must be equal\",20:\"Number of `origins` and `resolutions` must be equal\",22:\"Either `tileSize` or `tileSizes` must be configured, never both\",24:\"Invalid extent or geometry provided as `geometry`\",25:\"Cannot fit empty extent provided as `geometry`\",26:\"Features must have an id set\",27:\"Features must have an id set\",28:'`renderMode` must be `\"hybrid\"` or `\"vector\"`',30:\"The passed `feature` was already added to the source\",31:\"Tried to enqueue an `element` that was already added to the queue\",32:\"Transformation matrix cannot be inverted\",33:\"Invalid units\",34:\"Invalid geometry layout\",36:\"Unknown SRS type\",37:\"Unknown geometry type found\",38:\"`styleMapValue` has an unknown type\",39:\"Unknown geometry type\",40:\"Expected `feature` to have a geometry\",41:\"Expected an `ol/style/Style` or an array of `ol/style/Style.js`\",42:\"Question unknown, the answer is 42\",43:\"Expected `layers` to be an array or a `Collection`\",47:\"Expected `controls` to be an array or an `ol/Collection`\",48:\"Expected `interactions` to be an array or an `ol/Collection`\",49:\"Expected `overlays` to be an array or an `ol/Collection`\",50:\"`options.featureTypes` should be an Array\",51:\"Either `url` or `tileJSON` options must be provided\",52:\"Unknown `serverType` configured\",53:\"Unknown `tierSizeCalculation` configured\",55:\"The {-y} placeholder requires a tile grid with extent\",56:\"mapBrowserEvent must originate from a pointer event\",57:\"At least 2 conditions are required\",59:\"Invalid command found in the PBF\",60:\"Missing or invalid `size`\",61:\"Cannot determine IIIF Image API version from provided image information JSON\",62:\"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`\",64:\"Layer opacity must be a number\",66:\"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`\",67:\"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both\",68:\"A VectorTile source can only be rendered if it has a projection compatible with the view projection\",69:\"`width` or `height` cannot be provided together with `scale`\"};class o extends Error{constructor(e){const t=r[e];super(t),this.code=e,this.name=\"AssertionError\",this.message=t}}var i=o;function a(e,t){const n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function s(e,t){const n=(r=t)[0]*r[3]-r[1]*r[2];var r;!function(e,t){if(!e)throw new i(t)}(0!==n,32);const o=t[0],a=t[1],s=t[2],u=t[3],x=t[4],f=t[5];return e[0]=u/n,e[1]=-a/n,e[2]=-s/n,e[3]=o/n,e[4]=(s*f-u*x)/n,e[5]=-(o*f-a*x)/n,e}new Array(6);var u={exports:{}};function x(e,t,n){n=n||2;var r,o,i,a,s,u,x,l=t&&t.length,c=l?t[0]*n:e.length,v=f(e,0,c,n,!0),d=[];if(!v||v.next===v.prev)return d;if(l&&(v=function(e,t,n,r){var o,i,a,s=[];for(o=0,i=t.length;o<i;o++)(a=f(e,t[o]*r,o<i-1?t[o+1]*r:e.length,r,!1))===a.next&&(a.steiner=!0),s.push(w(a));for(s.sort(p),o=0;o<s.length;o++)n=b(s[o],n);return n}(e,t,v,n)),e.length>80*n){r=i=e[0],o=a=e[1];for(var y=n;y<c;y+=n)(s=e[y])<r&&(r=s),(u=e[y+1])<o&&(o=u),s>i&&(i=s),u>a&&(a=u);x=0!==(x=Math.max(i-r,a-o))?32767/x:0}return h(v,d,n,r,o,x,0),d}function f(e,t,n,r,o){var i,a;if(o===B(e,t,n,r)>0)for(i=t;i<n;i+=r)a=k(i,e[i],e[i+1],a);else for(i=n-r;i>=t;i-=r)a=k(i,e[i],e[i+1],a);return a&&M(a,a.next)&&(z(a),a=a.next),a}function l(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!M(r,r.next)&&0!==Z(r.prev,r,r.next))r=r.next;else{if(z(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function h(e,t,n,r,o,i,a){if(e){!a&&i&&function(e,t,n,r){var o=e;do{0===o.z&&(o.z=m(o.x,o.y,t,n,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var t,n,r,o,i,a,s,u,x=1;do{for(n=e,e=null,i=null,a=0;n;){for(a++,r=n,s=0,t=0;t<x&&(s++,r=r.nextZ);t++);for(u=x;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(o=n,n=n.nextZ,s--):(o=r,r=r.nextZ,u--),i?i.nextZ=o:e=o,o.prevZ=i,i=o;n=r}i.nextZ=null,x*=2}while(a>1)}(o)}(e,r,o,i);for(var s,u,x=e;e.prev!==e.next;)if(s=e.prev,u=e.next,i?v(e,r,o,i):c(e))t.push(s.i/n|0),t.push(e.i/n|0),t.push(u.i/n|0),z(e),e=u.next,x=u.next;else if((e=u)===x){a?1===a?h(e=d(l(e),t,n),t,n,r,o,i,2):2===a&&y(e,t,n,r,o,i):h(l(e),t,n,r,o,i,1);break}}}function c(e){var t=e.prev,n=e,r=e.next;if(Z(t,n,r)>=0)return!1;for(var o=t.x,i=n.x,a=r.x,s=t.y,u=n.y,x=r.y,f=o<i?o<a?o:a:i<a?i:a,l=s<u?s<x?s:x:u<x?u:x,h=o>i?o>a?o:a:i>a?i:a,c=s>u?s>x?s:x:u>x?u:x,v=r.next;v!==t;){if(v.x>=f&&v.x<=h&&v.y>=l&&v.y<=c&&A(o,s,i,u,a,x,v.x,v.y)&&Z(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function v(e,t,n,r){var o=e.prev,i=e,a=e.next;if(Z(o,i,a)>=0)return!1;for(var s=o.x,u=i.x,x=a.x,f=o.y,l=i.y,h=a.y,c=s<u?s<x?s:x:u<x?u:x,v=f<l?f<h?f:h:l<h?l:h,d=s>u?s>x?s:x:u>x?u:x,y=f>l?f>h?f:h:l>h?l:h,p=m(c,v,t,n,r),b=m(d,y,t,n,r),g=e.prevZ,w=e.nextZ;g&&g.z>=p&&w&&w.z<=b;){if(g.x>=c&&g.x<=d&&g.y>=v&&g.y<=y&&g!==o&&g!==a&&A(s,f,u,l,x,h,g.x,g.y)&&Z(g.prev,g,g.next)>=0)return!1;if(g=g.prevZ,w.x>=c&&w.x<=d&&w.y>=v&&w.y<=y&&w!==o&&w!==a&&A(s,f,u,l,x,h,w.x,w.y)&&Z(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;g&&g.z>=p;){if(g.x>=c&&g.x<=d&&g.y>=v&&g.y<=y&&g!==o&&g!==a&&A(s,f,u,l,x,h,g.x,g.y)&&Z(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;w&&w.z<=b;){if(w.x>=c&&w.x<=d&&w.y>=v&&w.y<=y&&w!==o&&w!==a&&A(s,f,u,l,x,h,w.x,w.y)&&Z(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function d(e,t,n){var r=e;do{var o=r.prev,i=r.next.next;!M(o,i)&&F(o,r,r.next,i)&&S(o,i)&&S(i,o)&&(t.push(o.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),z(r),z(r.next),r=e=i),r=r.next}while(r!==e);return l(r)}function y(e,t,n,r,o,i){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&E(a,s)){var u=U(a,s);return a=l(a,a.next),u=l(u,u.next),h(a,t,n,r,o,i,0),void h(u,t,n,r,o,i,0)}s=s.next}a=a.next}while(a!==e)}function p(e,t){return e.x-t.x}function b(e,t){var n=function(e,t){var n,r=t,o=e.x,i=e.y,a=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=o&&s>a&&(a=s,n=r.x<r.next.x?r:r.next,s===o))return n}r=r.next}while(r!==t);if(!n)return null;var u,x=n,f=n.x,l=n.y,h=1/0;r=n;do{o>=r.x&&r.x>=f&&o!==r.x&&A(i<l?o:a,i,f,l,i<l?a:o,i,r.x,r.y)&&(u=Math.abs(i-r.y)/(o-r.x),S(r,e)&&(u<h||u===h&&(r.x>n.x||r.x===n.x&&g(n,r)))&&(n=r,h=u)),r=r.next}while(r!==x);return n}(e,t);if(!n)return t;var r=U(n,e);return l(r,r.next),l(n,n.next)}function g(e,t){return Z(e.prev,e,t.prev)<0&&Z(t.next,e,e.next)<0}function m(e,t,n,r,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function w(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function A(e,t,n,r,o,i,a,s){return(o-a)*(t-s)>=(e-a)*(i-s)&&(e-a)*(r-s)>=(n-a)*(t-s)&&(n-a)*(i-s)>=(o-a)*(r-s)}function E(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&F(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(S(e,t)&&S(t,e)&&function(e,t){var n=e,r=!1,o=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&o<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Z(e.prev,e,t.prev)||Z(e,t.prev,t))||M(e,t)&&Z(e.prev,e,e.next)>0&&Z(t.prev,t,t.next)>0)}function Z(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function M(e,t){return e.x===t.x&&e.y===t.y}function F(e,t,n,r){var o=I(Z(e,t,n)),i=I(Z(e,t,r)),a=I(Z(n,r,e)),s=I(Z(n,r,t));return o!==i&&a!==s||(!(0!==o||!T(e,n,t))||(!(0!==i||!T(e,r,t))||(!(0!==a||!T(n,e,r))||!(0!==s||!T(n,t,r)))))}function T(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function I(e){return e>0?1:e<0?-1:0}function S(e,t){return Z(e.prev,e,e.next)<0?Z(e,t,e.next)>=0&&Z(e,e.prev,t)>=0:Z(e,t,e.prev)<0||Z(e,e.next,t)<0}function U(e,t){var n=new R(e.i,e.x,e.y),r=new R(t.i,t.x,t.y),o=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function k(e,t,n,r){var o=new R(e,t,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function z(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function R(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function B(e,t,n,r){for(var o=0,i=t,a=n-r;i<n;i+=r)o+=(e[a]-e[i])*(e[i+1]+e[a+1]),a=i;return o}u.exports=x,u.exports.default=x,x.deviation=function(e,t,n,r){var o=t&&t.length,i=o?t[0]*n:e.length,a=Math.abs(B(e,0,i,n));if(o)for(var s=0,u=t.length;s<u;s++){var x=t[s]*n,f=s<u-1?t[s+1]*n:e.length;a-=Math.abs(B(e,x,f,n))}var l=0;for(s=0;s<r.length;s+=3){var h=r[s]*n,c=r[s+1]*n,v=r[s+2]*n;l+=Math.abs((e[h]-e[v])*(e[c+1]-e[h+1])-(e[h]-e[c])*(e[v+1]-e[h+1]))}return 0===a&&0===l?0:Math.abs((l-a)/a)},x.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,o=0;o<e.length;o++){for(var i=0;i<e[o].length;i++)for(var a=0;a<t;a++)n.vertices.push(e[o][i][a]);o>0&&(r+=e[o-1].length,n.holes.push(r))}return n};const N=[],P={vertexPosition:0,indexPosition:0};function C(e,t,n,r,o){e[t+0]=n,e[t+1]=r,e[t+2]=o}function _(e,t,n,r,o,i){const a=3+o,s=e[t+0],u=e[t+1],x=N;x.length=o;for(let n=0;n<x.length;n++)x[n]=e[t+2+n];let f=i?i.vertexPosition:0,l=i?i.indexPosition:0;const h=f/a;return C(n,f,s,u,0),x.length&&n.set(x,f+3),f+=a,C(n,f,s,u,1),x.length&&n.set(x,f+3),f+=a,C(n,f,s,u,2),x.length&&n.set(x,f+3),f+=a,C(n,f,s,u,3),x.length&&n.set(x,f+3),f+=a,r[l++]=h,r[l++]=h+1,r[l++]=h+3,r[l++]=h+1,r[l++]=h+2,r[l++]=h+3,P.vertexPosition=f,P.indexPosition=l,P}function q(e,t,n,r,o,i,s,u,x,f){const l=5+u.length,h=i.length/l,c=[e[t+0],e[t+1]],v=[e[n],e[n+1]],d=a(f,[...c]),y=a(f,[...v]);function p(e,t,n){const r=1e4;return Math.round(1500*t)+Math.round(1500*n)*r+e*r*r}function b(e,t,n){const r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),o=[(t[0]-e[0])/r,(t[1]-e[1])/r],i=[-o[1],o[0]],a=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),s=[(n[0]-e[0])/a,(n[1]-e[1])/a],u=0===r||0===a?0:Math.acos((x=s[0]*o[0]+s[1]*o[1],f=-1,l=1,Math.min(Math.max(x,f),l)));var x,f,l;return s[0]*i[0]+s[1]*i[1]>0?u:2*Math.PI-u}const g=null!==o;let m=0,w=0;if(null!==r){m=b(d,y,a(f,[...[e[r],e[r+1]]]))}if(g){w=b(y,d,a(f,[...[e[o],e[o+1]]]))}i.push(c[0],c[1],v[0],v[1],p(0,m,w)),i.push(...u),i.push(c[0],c[1],v[0],v[1],p(1,m,w)),i.push(...u),i.push(c[0],c[1],v[0],v[1],p(2,m,w)),i.push(...u),i.push(c[0],c[1],v[0],v[1],p(3,m,w)),i.push(...u),s.push(h,h+1,h+2,h+1,h+3,h+2)}function L(e,t,n,r,o){const i=2+o;let a=t;const s=e.slice(a,a+o);a+=o;const x=e[a++];let f=0;const l=new Array(x-1);for(let t=0;t<x;t++)f+=e[a++],t<x-1&&(l[t]=f);const h=e.slice(a,a+2*f),c=u.exports(h,l,2);for(let e=0;e<c.length;e++)r.push(c[e]+n.length/i);for(let e=0;e<h.length;e+=2)n.push(h[e],h[e+1],...s);return a+2*f}const G=self;G.onmessage=r=>{const o=r.data;switch(o.type){case t:{const e=3,t=2,n=o.customAttributesCount,r=t+n,i=new Float32Array(o.renderInstructions),a=i.length/r,s=4*a*(n+e),u=new Uint32Array(6*a),x=new Float32Array(s);let f;for(let e=0;e<i.length;e+=r)f=_(i,e,x,u,n,f);const l=Object.assign({vertexBuffer:x.buffer,indexBuffer:u.buffer,renderInstructions:i.buffer},o);G.postMessage(l,[x.buffer,u.buffer,i.buffer]);break}case n:{const e=[],t=[],n=o.customAttributesCount,r=2,i=new Float32Array(o.renderInstructions);let a=0;const u=o.renderInstructionsTransform,x=[1,0,0,1,0,0];let f,l;for(s(x,u);a<i.length;){l=Array.from(i.slice(a,a+n)),a+=n,f=i[a++];for(let n=0;n<f-1;n++)q(i,a+n*r,a+(n+1)*r,n>0?a+(n-1)*r:null,n<f-2?a+(n+2)*r:null,e,t,l,0,x);a+=f*r}const h=Uint32Array.from(t),c=Float32Array.from(e),v=Object.assign({vertexBuffer:c.buffer,indexBuffer:h.buffer,renderInstructions:i.buffer},o);G.postMessage(v,[c.buffer,h.buffer,i.buffer]);break}case e:{const e=[],t=[],n=o.customAttributesCount,r=new Float32Array(o.renderInstructions);let i=0;for(;i<r.length;)i=L(r,i,e,t,n);const a=Uint32Array.from(t),s=Float32Array.from(e),u=Object.assign({vertexBuffer:s.buffer,indexBuffer:a.buffer,renderInstructions:r.buffer},o);G.postMessage(u,[s.buffer,a.buffer,r.buffer]);break}}};";
|
|
4
4
|
return new Worker(typeof Blob === 'undefined'
|
|
5
5
|
? 'data:application/javascript;base64,' + Buffer.from(source, 'binary').toString('base64')
|
|
6
6
|
: URL.createObjectURL(new Blob([source], {type: 'application/javascript'})));
|