ol 7.0.0-dev.1658967082721 → 7.0.0-dev.1659037691355
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/Map.d.ts.map +1 -1
- package/Map.js +1 -2
- package/Map.js.map +1 -1
- package/Object.js +3 -3
- package/Object.js.map +1 -1
- package/View.d.ts.map +1 -1
- package/View.js +5 -6
- package/View.js.map +1 -1
- package/coordinate.d.ts.map +1 -1
- package/coordinate.js +14 -14
- package/coordinate.js.map +1 -1
- package/format/EsriJSON.js +3 -3
- package/format/EsriJSON.js.map +1 -1
- package/format/Feature.d.ts.map +1 -1
- package/format/Feature.js +1 -2
- package/format/Feature.js.map +1 -1
- package/format/GML2.d.ts.map +1 -1
- package/format/GML2.js +2 -3
- package/format/GML2.js.map +1 -1
- package/format/GML3.d.ts.map +1 -1
- package/format/GML3.js +5 -6
- package/format/GML3.js.map +1 -1
- package/format/GMLBase.d.ts.map +1 -1
- package/format/GMLBase.js +1 -2
- package/format/GMLBase.js.map +1 -1
- package/format/GeoJSON.js +2 -2
- package/format/GeoJSON.js.map +1 -1
- package/format/WFS.d.ts.map +1 -1
- package/format/WFS.js +12 -13
- package/format/WFS.js.map +1 -1
- package/format/WKB.d.ts.map +1 -1
- package/format/WKB.js +2 -3
- package/format/WKB.js.map +1 -1
- package/format/WMSGetFeatureInfo.d.ts.map +1 -1
- package/format/WMSGetFeatureInfo.js +1 -2
- package/format/WMSGetFeatureInfo.js.map +1 -1
- package/interaction/Link.d.ts.map +1 -1
- package/interaction/Link.js +2 -3
- package/interaction/Link.js.map +1 -1
- package/layer/Base.d.ts.map +1 -1
- package/layer/Base.js +2 -3
- package/layer/Base.js.map +1 -1
- package/layer/BaseTile.d.ts.map +1 -1
- package/layer/BaseTile.js +1 -2
- package/layer/BaseTile.js.map +1 -1
- package/layer/BaseVector.d.ts.map +1 -1
- package/layer/BaseVector.js +1 -2
- package/layer/BaseVector.js.map +1 -1
- package/layer/Graticule.d.ts.map +1 -1
- package/layer/Graticule.js +1 -2
- package/layer/Graticule.js.map +1 -1
- package/layer/Group.js +2 -2
- package/layer/Group.js.map +1 -1
- package/layer/Heatmap.d.ts.map +1 -1
- package/layer/Heatmap.js +1 -2
- package/layer/Heatmap.js.map +1 -1
- package/layer/Layer.d.ts.map +1 -1
- package/layer/Layer.js +1 -2
- package/layer/Layer.js.map +1 -1
- package/layer/VectorImage.d.ts.map +1 -1
- package/layer/VectorImage.js +1 -2
- package/layer/VectorImage.js.map +1 -1
- package/layer/VectorTile.d.ts.map +1 -1
- package/layer/VectorTile.js +1 -2
- package/layer/VectorTile.js.map +1 -1
- package/layer/WebGLPoints.d.ts.map +1 -1
- package/layer/WebGLPoints.js +2 -3
- package/layer/WebGLPoints.js.map +1 -1
- package/layer/WebGLTile.d.ts.map +1 -1
- package/layer/WebGLTile.js +2 -3
- package/layer/WebGLTile.js.map +1 -1
- package/obj.d.ts +3 -1
- package/obj.d.ts.map +1 -1
- package/obj.js +0 -28
- package/obj.js.map +1 -1
- package/package.json +2 -2
- package/renderer/canvas/ImageLayer.d.ts.map +1 -1
- package/renderer/canvas/ImageLayer.js +2 -3
- package/renderer/canvas/ImageLayer.js.map +1 -1
- package/renderer/canvas/TileLayer.d.ts.map +1 -1
- package/renderer/canvas/TileLayer.js +2 -3
- package/renderer/canvas/TileLayer.js.map +1 -1
- package/renderer/canvas/VectorImageLayer.d.ts.map +1 -1
- package/renderer/canvas/VectorImageLayer.js +3 -4
- package/renderer/canvas/VectorImageLayer.js.map +1 -1
- package/reproj.d.ts.map +1 -1
- package/reproj.js +2 -3
- package/reproj.js.map +1 -1
- package/source/CartoDB.d.ts.map +1 -1
- package/source/CartoDB.js +1 -2
- package/source/CartoDB.js.map +1 -1
- package/source/DataTile.d.ts.map +1 -1
- package/source/DataTile.js +1 -2
- package/source/DataTile.js.map +1 -1
- package/source/ImageArcGISRest.d.ts.map +1 -1
- package/source/ImageArcGISRest.js +2 -3
- package/source/ImageArcGISRest.js.map +1 -1
- package/source/ImageMapGuide.d.ts.map +1 -1
- package/source/ImageMapGuide.js +2 -3
- package/source/ImageMapGuide.js.map +1 -1
- package/source/ImageStatic.d.ts.map +1 -1
- package/source/ImageStatic.js +1 -2
- package/source/ImageStatic.js.map +1 -1
- package/source/ImageWMS.d.ts.map +1 -1
- package/source/ImageWMS.js +4 -5
- package/source/ImageWMS.js.map +1 -1
- package/source/Raster.d.ts.map +1 -1
- package/source/Raster.js +2 -3
- package/source/Raster.js.map +1 -1
- package/source/TileArcGISRest.d.ts.map +1 -1
- package/source/TileArcGISRest.js +2 -3
- package/source/TileArcGISRest.js.map +1 -1
- package/source/TileWMS.d.ts.map +1 -1
- package/source/TileWMS.js +4 -5
- package/source/TileWMS.js.map +1 -1
- package/source/WMTS.d.ts.map +1 -1
- package/source/WMTS.js +3 -4
- package/source/WMTS.js.map +1 -1
- package/source/ogcTileUtil.d.ts.map +1 -1
- package/source/ogcTileUtil.js +1 -2
- package/source/ogcTileUtil.js.map +1 -1
- package/src/Map.js +1 -2
- package/src/Object.js +3 -3
- package/src/View.js +5 -6
- package/src/coordinate.js +15 -16
- package/src/format/EsriJSON.js +3 -3
- package/src/format/Feature.js +1 -2
- package/src/format/GML2.js +2 -3
- package/src/format/GML3.js +5 -6
- package/src/format/GMLBase.js +1 -2
- package/src/format/GeoJSON.js +2 -2
- package/src/format/WFS.js +15 -13
- package/src/format/WKB.js +2 -3
- package/src/format/WMSGetFeatureInfo.js +1 -2
- package/src/interaction/Link.js +2 -3
- package/src/layer/Base.js +2 -3
- package/src/layer/BaseTile.js +1 -2
- package/src/layer/BaseVector.js +1 -2
- package/src/layer/Graticule.js +1 -2
- package/src/layer/Group.js +2 -2
- package/src/layer/Heatmap.js +1 -2
- package/src/layer/Layer.js +1 -2
- package/src/layer/VectorImage.js +1 -2
- package/src/layer/VectorTile.js +1 -2
- package/src/layer/WebGLPoints.js +2 -3
- package/src/layer/WebGLTile.js +2 -3
- package/src/obj.js +0 -31
- package/src/renderer/canvas/ImageLayer.js +2 -3
- package/src/renderer/canvas/TileLayer.js +2 -3
- package/src/renderer/canvas/VectorImageLayer.js +3 -4
- package/src/reproj.js +2 -3
- package/src/source/CartoDB.js +1 -2
- package/src/source/DataTile.js +1 -2
- package/src/source/ImageArcGISRest.js +2 -3
- package/src/source/ImageMapGuide.js +2 -3
- package/src/source/ImageStatic.js +1 -2
- package/src/source/ImageWMS.js +4 -5
- package/src/source/Raster.js +2 -3
- package/src/source/TileArcGISRest.js +2 -3
- package/src/source/TileWMS.js +4 -5
- package/src/source/WMTS.js +3 -4
- package/src/source/ogcTileUtil.js +1 -2
- package/src/webgl.js +1 -2
- package/src/worker/webgl.js +1 -1
- package/util.js +1 -1
- package/webgl.d.ts.map +1 -1
- package/webgl.js +1 -2
- package/webgl.js.map +1 -1
- package/worker/webgl.js +1 -1
- package/worker/webgl.js.map +1 -1
package/src/obj.js
CHANGED
|
@@ -2,37 +2,6 @@
|
|
|
2
2
|
* @module ol/obj
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Polyfill for Object.assign(). Assigns enumerable and own properties from
|
|
7
|
-
* one or more source objects to a target object.
|
|
8
|
-
* See https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign.
|
|
9
|
-
*
|
|
10
|
-
* @param {!Object} target The target object.
|
|
11
|
-
* @param {...Object} var_sources The source object(s).
|
|
12
|
-
* @return {!Object} The modified target object.
|
|
13
|
-
*/
|
|
14
|
-
export const assign =
|
|
15
|
-
typeof Object.assign === 'function'
|
|
16
|
-
? Object.assign
|
|
17
|
-
: function (target, var_sources) {
|
|
18
|
-
if (target === undefined || target === null) {
|
|
19
|
-
throw new TypeError('Cannot convert undefined or null to object');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const output = Object(target);
|
|
23
|
-
for (let i = 1, ii = arguments.length; i < ii; ++i) {
|
|
24
|
-
const source = arguments[i];
|
|
25
|
-
if (source !== undefined && source !== null) {
|
|
26
|
-
for (const key in source) {
|
|
27
|
-
if (source.hasOwnProperty(key)) {
|
|
28
|
-
output[key] = source[key];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return output;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
5
|
/**
|
|
37
6
|
* Removes all properties from an object.
|
|
38
7
|
* @param {Object} object The object to clear.
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
makeInverse,
|
|
13
13
|
toString as toTransformString,
|
|
14
14
|
} from '../../transform.js';
|
|
15
|
-
import {assign} from '../../obj.js';
|
|
16
15
|
import {
|
|
17
16
|
containsCoordinate,
|
|
18
17
|
containsExtent,
|
|
@@ -239,7 +238,7 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
|
|
239
238
|
const dh = img.height * transform[3];
|
|
240
239
|
|
|
241
240
|
if (!this.getLayer().getSource().getInterpolate()) {
|
|
242
|
-
assign(context, IMAGE_SMOOTHING_DISABLED);
|
|
241
|
+
Object.assign(context, IMAGE_SMOOTHING_DISABLED);
|
|
243
242
|
}
|
|
244
243
|
|
|
245
244
|
this.preRender(context, frameState);
|
|
@@ -262,7 +261,7 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
|
|
262
261
|
if (clipped) {
|
|
263
262
|
context.restore();
|
|
264
263
|
}
|
|
265
|
-
assign(context, IMAGE_SMOOTHING_ENABLED);
|
|
264
|
+
Object.assign(context, IMAGE_SMOOTHING_ENABLED);
|
|
266
265
|
|
|
267
266
|
if (canvasTransform !== canvas.style.transform) {
|
|
268
267
|
canvas.style.transform = canvasTransform;
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
makeInverse,
|
|
14
14
|
toString as toTransformString,
|
|
15
15
|
} from '../../transform.js';
|
|
16
|
-
import {assign} from '../../obj.js';
|
|
17
16
|
import {
|
|
18
17
|
containsCoordinate,
|
|
19
18
|
createEmpty,
|
|
@@ -411,7 +410,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|
|
411
410
|
}
|
|
412
411
|
|
|
413
412
|
if (!tileSource.getInterpolate()) {
|
|
414
|
-
assign(context, IMAGE_SMOOTHING_DISABLED);
|
|
413
|
+
Object.assign(context, IMAGE_SMOOTHING_DISABLED);
|
|
415
414
|
}
|
|
416
415
|
|
|
417
416
|
this.preRender(context, frameState);
|
|
@@ -562,7 +561,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|
|
562
561
|
if (layerState.extent) {
|
|
563
562
|
context.restore();
|
|
564
563
|
}
|
|
565
|
-
assign(context, IMAGE_SMOOTHING_ENABLED);
|
|
564
|
+
Object.assign(context, IMAGE_SMOOTHING_ENABLED);
|
|
566
565
|
|
|
567
566
|
if (canvasTransform !== canvas.style.transform) {
|
|
568
567
|
canvas.style.transform = canvasTransform;
|
|
@@ -9,7 +9,6 @@ import ImageState from '../../ImageState.js';
|
|
|
9
9
|
import RBush from 'rbush';
|
|
10
10
|
import ViewHint from '../../ViewHint.js';
|
|
11
11
|
import {apply, compose, create} from '../../transform.js';
|
|
12
|
-
import {assign} from '../../obj.js';
|
|
13
12
|
import {getHeight, getWidth, isEmpty, scaleFromCenter} from '../../extent.js';
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -109,15 +108,15 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
|
|
|
109
108
|
const context = vectorRenderer.context;
|
|
110
109
|
const layerState = frameState.layerStatesArray[frameState.layerIndex];
|
|
111
110
|
context.globalAlpha = layerState.opacity;
|
|
112
|
-
const imageLayerState = assign({}, layerState, {opacity: 1});
|
|
111
|
+
const imageLayerState = Object.assign({}, layerState, {opacity: 1});
|
|
113
112
|
const imageFrameState =
|
|
114
113
|
/** @type {import("../../PluggableMap.js").FrameState} */ (
|
|
115
|
-
assign({}, frameState, {
|
|
114
|
+
Object.assign({}, frameState, {
|
|
116
115
|
declutterTree: new RBush(9),
|
|
117
116
|
extent: renderedExtent,
|
|
118
117
|
size: [width, height],
|
|
119
118
|
viewState: /** @type {import("../../View.js").State} */ (
|
|
120
|
-
assign({}, frameState.viewState, {
|
|
119
|
+
Object.assign({}, frameState.viewState, {
|
|
121
120
|
rotation: 0,
|
|
122
121
|
})
|
|
123
122
|
),
|
package/src/reproj.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* @module ol/reproj
|
|
3
3
|
*/
|
|
4
4
|
import {IMAGE_SMOOTHING_DISABLED} from './renderer/canvas/common.js';
|
|
5
|
-
import {assign} from './obj.js';
|
|
6
5
|
import {
|
|
7
6
|
containsCoordinate,
|
|
8
7
|
createEmpty,
|
|
@@ -227,7 +226,7 @@ export function render(
|
|
|
227
226
|
);
|
|
228
227
|
|
|
229
228
|
if (!opt_interpolate) {
|
|
230
|
-
assign(context, IMAGE_SMOOTHING_DISABLED);
|
|
229
|
+
Object.assign(context, IMAGE_SMOOTHING_DISABLED);
|
|
231
230
|
}
|
|
232
231
|
|
|
233
232
|
if (sources.length === 0) {
|
|
@@ -255,7 +254,7 @@ export function render(
|
|
|
255
254
|
);
|
|
256
255
|
|
|
257
256
|
if (!opt_interpolate) {
|
|
258
|
-
assign(stitchContext, IMAGE_SMOOTHING_DISABLED);
|
|
257
|
+
Object.assign(stitchContext, IMAGE_SMOOTHING_DISABLED);
|
|
259
258
|
}
|
|
260
259
|
|
|
261
260
|
const stitchScale = pixelRatio / sourceResolution;
|
package/src/source/CartoDB.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import XYZ from './XYZ.js';
|
|
6
|
-
import {assign} from '../obj.js';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* @typedef {Object} Options
|
|
@@ -104,7 +103,7 @@ class CartoDB extends XYZ {
|
|
|
104
103
|
* @api
|
|
105
104
|
*/
|
|
106
105
|
updateConfig(config) {
|
|
107
|
-
assign(this.config_, config);
|
|
106
|
+
Object.assign(this.config_, config);
|
|
108
107
|
this.initializeMap_();
|
|
109
108
|
}
|
|
110
109
|
|
package/src/source/DataTile.js
CHANGED
|
@@ -6,7 +6,6 @@ import EventType from '../events/EventType.js';
|
|
|
6
6
|
import TileEventType from './TileEventType.js';
|
|
7
7
|
import TileSource, {TileSourceEvent} from './Tile.js';
|
|
8
8
|
import TileState from '../TileState.js';
|
|
9
|
-
import {assign} from '../obj.js';
|
|
10
9
|
import {createXYZ, extentFromProjection} from '../tilegrid.js';
|
|
11
10
|
import {getKeyZXY} from '../tilecoord.js';
|
|
12
11
|
import {getUid} from '../util.js';
|
|
@@ -197,7 +196,7 @@ class DataTileSource extends TileSource {
|
|
|
197
196
|
});
|
|
198
197
|
}
|
|
199
198
|
|
|
200
|
-
const options = assign(
|
|
199
|
+
const options = Object.assign(
|
|
201
200
|
{
|
|
202
201
|
tileCoord: [z, x, y],
|
|
203
202
|
loader: loader,
|
|
@@ -7,7 +7,6 @@ import ImageSource, {defaultImageLoadFunction} from './Image.js';
|
|
|
7
7
|
import ImageWrapper from '../Image.js';
|
|
8
8
|
import {appendParams} from '../uri.js';
|
|
9
9
|
import {assert} from '../asserts.js';
|
|
10
|
-
import {assign} from '../obj.js';
|
|
11
10
|
import {containsExtent, getHeight, getWidth} from '../extent.js';
|
|
12
11
|
|
|
13
12
|
/**
|
|
@@ -172,7 +171,7 @@ class ImageArcGISRest extends ImageSource {
|
|
|
172
171
|
'FORMAT': 'PNG32',
|
|
173
172
|
'TRANSPARENT': true,
|
|
174
173
|
};
|
|
175
|
-
assign(params, this.params_);
|
|
174
|
+
Object.assign(params, this.params_);
|
|
176
175
|
|
|
177
176
|
extent = extent.slice();
|
|
178
177
|
const centerX = (extent[0] + extent[2]) / 2;
|
|
@@ -311,7 +310,7 @@ class ImageArcGISRest extends ImageSource {
|
|
|
311
310
|
* @api
|
|
312
311
|
*/
|
|
313
312
|
updateParams(params) {
|
|
314
|
-
assign(this.params_, params);
|
|
313
|
+
Object.assign(this.params_, params);
|
|
315
314
|
this.image_ = null;
|
|
316
315
|
this.changed();
|
|
317
316
|
}
|
|
@@ -6,7 +6,6 @@ import EventType from '../events/EventType.js';
|
|
|
6
6
|
import ImageSource, {defaultImageLoadFunction} from './Image.js';
|
|
7
7
|
import ImageWrapper from '../Image.js';
|
|
8
8
|
import {appendParams} from '../uri.js';
|
|
9
|
-
import {assign} from '../obj.js';
|
|
10
9
|
import {
|
|
11
10
|
containsExtent,
|
|
12
11
|
getCenter,
|
|
@@ -220,7 +219,7 @@ class ImageMapGuide extends ImageSource {
|
|
|
220
219
|
* @api
|
|
221
220
|
*/
|
|
222
221
|
updateParams(params) {
|
|
223
|
-
assign(this.params_, params);
|
|
222
|
+
Object.assign(this.params_, params);
|
|
224
223
|
this.changed();
|
|
225
224
|
}
|
|
226
225
|
|
|
@@ -250,7 +249,7 @@ class ImageMapGuide extends ImageSource {
|
|
|
250
249
|
'SETVIEWCENTERX': center[0],
|
|
251
250
|
'SETVIEWCENTERY': center[1],
|
|
252
251
|
};
|
|
253
|
-
assign(baseParams, params);
|
|
252
|
+
Object.assign(baseParams, params);
|
|
254
253
|
return appendParams(baseUrl, baseParams);
|
|
255
254
|
}
|
|
256
255
|
|
|
@@ -7,7 +7,6 @@ import ImageSource, {defaultImageLoadFunction} from './Image.js';
|
|
|
7
7
|
import ImageState from '../ImageState.js';
|
|
8
8
|
import ImageWrapper from '../Image.js';
|
|
9
9
|
import {IMAGE_SMOOTHING_DISABLED} from '../renderer/canvas/common.js';
|
|
10
|
-
import {assign} from '../obj.js';
|
|
11
10
|
import {createCanvasContext2D} from '../dom.js';
|
|
12
11
|
import {getHeight, getWidth, intersects} from '../extent.js';
|
|
13
12
|
import {get as getProjection} from '../proj.js';
|
|
@@ -158,7 +157,7 @@ class Static extends ImageSource {
|
|
|
158
157
|
if (targetWidth !== imageWidth || targetHeight !== imageHeight) {
|
|
159
158
|
const context = createCanvasContext2D(targetWidth, targetHeight);
|
|
160
159
|
if (!this.getInterpolate()) {
|
|
161
|
-
assign(context, IMAGE_SMOOTHING_DISABLED);
|
|
160
|
+
Object.assign(context, IMAGE_SMOOTHING_DISABLED);
|
|
162
161
|
}
|
|
163
162
|
const canvas = context.canvas;
|
|
164
163
|
context.drawImage(
|
package/src/source/ImageWMS.js
CHANGED
|
@@ -8,7 +8,6 @@ import ImageWrapper from '../Image.js';
|
|
|
8
8
|
import {DEFAULT_VERSION} from './wms.js';
|
|
9
9
|
import {appendParams} from '../uri.js';
|
|
10
10
|
import {assert} from '../asserts.js';
|
|
11
|
-
import {assign} from '../obj.js';
|
|
12
11
|
import {calculateSourceResolution} from '../reproj.js';
|
|
13
12
|
import {ceil, floor, round} from '../math.js';
|
|
14
13
|
import {compareVersions} from '../string.js';
|
|
@@ -206,7 +205,7 @@ class ImageWMS extends ImageSource {
|
|
|
206
205
|
'TRANSPARENT': true,
|
|
207
206
|
'QUERY_LAYERS': this.params_['LAYERS'],
|
|
208
207
|
};
|
|
209
|
-
assign(baseParams, this.params_, params);
|
|
208
|
+
Object.assign(baseParams, this.params_, params);
|
|
210
209
|
|
|
211
210
|
const x = floor((coordinate[0] - extent[0]) / resolution, DECIMALS);
|
|
212
211
|
const y = floor((extent[3] - coordinate[1]) / resolution, DECIMALS);
|
|
@@ -265,7 +264,7 @@ class ImageWMS extends ImageSource {
|
|
|
265
264
|
baseParams['SCALE'] = (resolution * mpu) / pixelSize;
|
|
266
265
|
}
|
|
267
266
|
|
|
268
|
-
assign(baseParams, params);
|
|
267
|
+
Object.assign(baseParams, params);
|
|
269
268
|
|
|
270
269
|
return appendParams(/** @type {string} */ (this.url_), baseParams);
|
|
271
270
|
}
|
|
@@ -338,7 +337,7 @@ class ImageWMS extends ImageSource {
|
|
|
338
337
|
'FORMAT': 'image/png',
|
|
339
338
|
'TRANSPARENT': true,
|
|
340
339
|
};
|
|
341
|
-
assign(params, this.params_);
|
|
340
|
+
Object.assign(params, this.params_);
|
|
342
341
|
|
|
343
342
|
this.imageSize_[0] = round(
|
|
344
343
|
getWidth(requestExtent) / imageResolution,
|
|
@@ -480,7 +479,7 @@ class ImageWMS extends ImageSource {
|
|
|
480
479
|
* @api
|
|
481
480
|
*/
|
|
482
481
|
updateParams(params) {
|
|
483
|
-
assign(this.params_, params);
|
|
482
|
+
Object.assign(this.params_, params);
|
|
484
483
|
this.updateV13_();
|
|
485
484
|
this.image_ = null;
|
|
486
485
|
this.changed();
|
package/src/source/Raster.js
CHANGED
|
@@ -11,7 +11,6 @@ import Source from './Source.js';
|
|
|
11
11
|
import TileLayer from '../layer/Tile.js';
|
|
12
12
|
import TileQueue from '../TileQueue.js';
|
|
13
13
|
import TileSource from './Tile.js';
|
|
14
|
-
import {assign} from '../obj.js';
|
|
15
14
|
import {createCanvasContext2D} from '../dom.js';
|
|
16
15
|
import {create as createTransform} from '../transform.js';
|
|
17
16
|
import {equals, getCenter, getHeight, getWidth} from '../extent.js';
|
|
@@ -711,11 +710,11 @@ class RasterSource extends ImageSource {
|
|
|
711
710
|
*/
|
|
712
711
|
updateFrameState_(extent, resolution, projection) {
|
|
713
712
|
const frameState = /** @type {import("../PluggableMap.js").FrameState} */ (
|
|
714
|
-
assign({}, this.frameState_)
|
|
713
|
+
Object.assign({}, this.frameState_)
|
|
715
714
|
);
|
|
716
715
|
|
|
717
716
|
frameState.viewState = /** @type {import("../View.js").State} */ (
|
|
718
|
-
assign({}, frameState.viewState)
|
|
717
|
+
Object.assign({}, frameState.viewState)
|
|
719
718
|
);
|
|
720
719
|
|
|
721
720
|
const center = getCenter(extent);
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import TileImage from './TileImage.js';
|
|
6
6
|
import {appendParams} from '../uri.js';
|
|
7
|
-
import {assign} from '../obj.js';
|
|
8
7
|
import {createEmpty} from '../extent.js';
|
|
9
8
|
import {modulo} from '../math.js';
|
|
10
9
|
import {scale as scaleSize, toSize} from '../size.js';
|
|
@@ -208,7 +207,7 @@ class TileArcGISRest extends TileImage {
|
|
|
208
207
|
* @api
|
|
209
208
|
*/
|
|
210
209
|
updateParams(params) {
|
|
211
|
-
assign(this.params_, params);
|
|
210
|
+
Object.assign(this.params_, params);
|
|
212
211
|
this.setKey(this.getKeyForParams_());
|
|
213
212
|
}
|
|
214
213
|
|
|
@@ -246,7 +245,7 @@ class TileArcGISRest extends TileImage {
|
|
|
246
245
|
'FORMAT': 'PNG32',
|
|
247
246
|
'TRANSPARENT': true,
|
|
248
247
|
};
|
|
249
|
-
assign(baseParams, this.params_);
|
|
248
|
+
Object.assign(baseParams, this.params_);
|
|
250
249
|
|
|
251
250
|
return this.getRequestUrl_(
|
|
252
251
|
tileCoord,
|
package/src/source/TileWMS.js
CHANGED
|
@@ -6,7 +6,6 @@ import TileImage from './TileImage.js';
|
|
|
6
6
|
import {DEFAULT_VERSION} from './wms.js';
|
|
7
7
|
import {appendParams} from '../uri.js';
|
|
8
8
|
import {assert} from '../asserts.js';
|
|
9
|
-
import {assign} from '../obj.js';
|
|
10
9
|
import {buffer, createEmpty} from '../extent.js';
|
|
11
10
|
import {buffer as bufferSize, scale as scaleSize, toSize} from '../size.js';
|
|
12
11
|
import {calculateSourceResolution} from '../reproj.js';
|
|
@@ -218,7 +217,7 @@ class TileWMS extends TileImage {
|
|
|
218
217
|
'TRANSPARENT': true,
|
|
219
218
|
'QUERY_LAYERS': this.params_['LAYERS'],
|
|
220
219
|
};
|
|
221
|
-
assign(baseParams, this.params_, params);
|
|
220
|
+
Object.assign(baseParams, this.params_, params);
|
|
222
221
|
|
|
223
222
|
const x = Math.floor((coordinate[0] - tileExtent[0]) / tileResolution);
|
|
224
223
|
const y = Math.floor((tileExtent[3] - coordinate[1]) / tileResolution);
|
|
@@ -279,7 +278,7 @@ class TileWMS extends TileImage {
|
|
|
279
278
|
baseParams['SCALE'] = (resolution * mpu) / pixelSize;
|
|
280
279
|
}
|
|
281
280
|
|
|
282
|
-
assign(baseParams, params);
|
|
281
|
+
Object.assign(baseParams, params);
|
|
283
282
|
|
|
284
283
|
return appendParams(/** @type {string} */ (this.urls[0]), baseParams);
|
|
285
284
|
}
|
|
@@ -407,7 +406,7 @@ class TileWMS extends TileImage {
|
|
|
407
406
|
* @api
|
|
408
407
|
*/
|
|
409
408
|
updateParams(params) {
|
|
410
|
-
assign(this.params_, params);
|
|
409
|
+
Object.assign(this.params_, params);
|
|
411
410
|
this.updateV13_();
|
|
412
411
|
this.setKey(this.getKeyForParams_());
|
|
413
412
|
}
|
|
@@ -462,7 +461,7 @@ class TileWMS extends TileImage {
|
|
|
462
461
|
'FORMAT': 'image/png',
|
|
463
462
|
'TRANSPARENT': true,
|
|
464
463
|
};
|
|
465
|
-
assign(baseParams, this.params_);
|
|
464
|
+
Object.assign(baseParams, this.params_);
|
|
466
465
|
|
|
467
466
|
return this.getRequestUrl_(
|
|
468
467
|
tileCoord,
|
package/src/source/WMTS.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import TileImage from './TileImage.js';
|
|
6
6
|
import {appendParams} from '../uri.js';
|
|
7
|
-
import {assign} from '../obj.js';
|
|
8
7
|
import {containsExtent} from '../extent.js';
|
|
9
8
|
import {createFromCapabilitiesMatrixSet} from '../tilegrid/WMTS.js';
|
|
10
9
|
import {createFromTileUrlFunctions, expandUrl} from '../tileurlfunction.js';
|
|
@@ -267,7 +266,7 @@ class WMTS extends TileImage {
|
|
|
267
266
|
* @api
|
|
268
267
|
*/
|
|
269
268
|
updateDimensions(dimensions) {
|
|
270
|
-
assign(this.dimensions_, dimensions);
|
|
269
|
+
Object.assign(this.dimensions_, dimensions);
|
|
271
270
|
this.setKey(this.getKeyForDimensions_());
|
|
272
271
|
}
|
|
273
272
|
|
|
@@ -287,7 +286,7 @@ class WMTS extends TileImage {
|
|
|
287
286
|
};
|
|
288
287
|
|
|
289
288
|
if (requestEncoding == 'KVP') {
|
|
290
|
-
assign(context, {
|
|
289
|
+
Object.assign(context, {
|
|
291
290
|
'Service': 'WMTS',
|
|
292
291
|
'Request': 'GetTile',
|
|
293
292
|
'Version': this.version_,
|
|
@@ -327,7 +326,7 @@ class WMTS extends TileImage {
|
|
|
327
326
|
'TileCol': tileCoord[1],
|
|
328
327
|
'TileRow': tileCoord[2],
|
|
329
328
|
};
|
|
330
|
-
assign(localContext, dimensions);
|
|
329
|
+
Object.assign(localContext, dimensions);
|
|
331
330
|
let url = template;
|
|
332
331
|
if (requestEncoding == 'KVP') {
|
|
333
332
|
url = appendParams(url, localContext);
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import TileGrid from '../tilegrid/TileGrid.js';
|
|
6
|
-
import {assign} from '../obj.js';
|
|
7
6
|
import {getJSON, resolveUrl} from '../net.js';
|
|
8
7
|
import {get as getProjection} from '../proj.js';
|
|
9
8
|
import {getIntersection as intersectExtents} from '../extent.js';
|
|
@@ -324,7 +323,7 @@ function parseTileMatrixSet(
|
|
|
324
323
|
}
|
|
325
324
|
}
|
|
326
325
|
|
|
327
|
-
assign(localContext, context);
|
|
326
|
+
Object.assign(localContext, context);
|
|
328
327
|
|
|
329
328
|
const url = tileUrlTemplate.replace(/\{(\w+?)\}/g, function (m, p) {
|
|
330
329
|
return localContext[p];
|
package/src/webgl.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import {SAFARI_BUG_237906} from './has.js';
|
|
6
|
-
import {assign} from './obj.js';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* Constants taken from goog.webgl
|
|
@@ -92,7 +91,7 @@ const CONTEXT_IDS = ['experimental-webgl', 'webgl', 'webkit-3d', 'moz-webgl'];
|
|
|
92
91
|
* @return {WebGLRenderingContext} WebGL rendering context.
|
|
93
92
|
*/
|
|
94
93
|
export function getContext(canvas, opt_attributes) {
|
|
95
|
-
const attributes = assign(
|
|
94
|
+
const attributes = Object.assign(
|
|
96
95
|
{
|
|
97
96
|
preserveDrawingBuffer: true,
|
|
98
97
|
antialias: SAFARI_BUG_237906 ? false : true, // https://bugs.webkit.org/show_bug.cgi?id=237906
|
package/src/worker/webgl.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
export function create() {
|
|
3
|
-
const source = "const e=\"GENERATE_POLYGON_BUFFERS\",n=\"GENERATE_POINT_BUFFERS\",t=\"GENERATE_LINE_STRING_BUFFERS\",r=\"function\"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError(\"Cannot convert undefined or null to object\");const t=Object(e);for(let e=1,n=arguments.length;e<n;++e){const n=arguments[e];if(null!=n)for(const e in n)n.hasOwnProperty(e)&&(t[e]=n[e])}return t},o=\"undefined\"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():\"\";o.indexOf(\"firefox\");-1!==o.indexOf(\"safari\")&&-1==o.indexOf(\"chrom\")&&(o.indexOf(\"version/15.4\")>=0||o.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==o.indexOf(\"webkit\")&&o.indexOf(\"edge\"),o.indexOf(\"macintosh\"),\"undefined\"!=typeof WorkerGlobalScope&&\"undefined\"!=typeof OffscreenCanvas&&(self,WorkerGlobalScope),function(){let e=!1;try{const n=Object.defineProperty({},\"passive\",{get:function(){e=!0}});window.addEventListener(\"_\",null,n),window.removeEventListener(\"_\",null,n)}catch(e){}}();class x extends Error{constructor(e){const n=\"Assertion failed. See https://openlayers.org/en/latest/doc/errors/#\"+e+\" for details.\";super(n),this.code=e,this.name=\"AssertionError\",this.message=n}}function i(e,n){const t=n[0],r=n[1];return n[0]=e[0]*t+e[2]*r+e[4],n[1]=e[1]*t+e[3]*r+e[5],n}function u(e,n){const t=(r=n)[0]*r[3]-r[1]*r[2];var r;!function(e,n){if(!e)throw new x(n)}(0!==t,32);const o=n[0],i=n[1],u=n[2],f=n[3],s=n[4],a=n[5];return e[0]=f/t,e[1]=-i/t,e[2]=-u/t,e[3]=o/t,e[4]=(u*a-f*s)/t,e[5]=-(o*a-i*s)/t,e}new Array(6);var f={exports:{}};function s(e,n,t){t=t||2;var r,o,x,i,u,f,s,v=n&&n.length,h=v?n[0]*t:e.length,y=a(e,0,h,t,!0),p=[];if(!y||y.next===y.prev)return p;if(v&&(y=function(e,n,t,r){var o,x,i,u=[];for(o=0,x=n.length;o<x;o++)(i=a(e,n[o]*r,o<x-1?n[o+1]*r:e.length,r,!1))===i.next&&(i.steiner=!0),u.push(Z(i));for(u.sort(d),o=0;o<u.length;o++)t=l(t=g(u[o],t),t.next);return t}(e,n,y,t)),e.length>80*t){r=x=e[0],o=i=e[1];for(var b=t;b<h;b+=t)(u=e[b])<r&&(r=u),(f=e[b+1])<o&&(o=f),u>x&&(x=u),f>i&&(i=f);s=0!==(s=Math.max(x-r,i-o))?1/s:0}return c(y,p,t,r,o,s),p}function a(e,n,t,r,o){var x,i;if(o===G(e,n,t,r)>0)for(x=n;x<t;x+=r)i=k(x,e[x],e[x+1],i);else for(x=t-r;x>=n;x-=r)i=k(x,e[x],e[x+1],i);return i&&E(i,i.next)&&(z(i),i=i.next),i}function l(e,n){if(!e)return e;n||(n=e);var t,r=e;do{if(t=!1,r.steiner||!E(r,r.next)&&0!==M(r.prev,r,r.next))r=r.next;else{if(z(r),(r=n=r.prev)===r.next)break;t=!0}}while(t||r!==n);return n}function c(e,n,t,r,o,x,i){if(e){!i&&x&&function(e,n,t,r){var o=e;do{null===o.z&&(o.z=w(o.x,o.y,n,t,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 n,t,r,o,x,i,u,f,s=1;do{for(t=e,e=null,x=null,i=0;t;){for(i++,r=t,u=0,n=0;n<s&&(u++,r=r.nextZ);n++);for(f=s;u>0||f>0&&r;)0!==u&&(0===f||!r||t.z<=r.z)?(o=t,t=t.nextZ,u--):(o=r,r=r.nextZ,f--),x?x.nextZ=o:e=o,o.prevZ=x,x=o;t=r}x.nextZ=null,s*=2}while(i>1)}(o)}(e,r,o,x);for(var u,f,s=e;e.prev!==e.next;)if(u=e.prev,f=e.next,x?h(e,r,o,x):v(e))n.push(u.i/t),n.push(e.i/t),n.push(f.i/t),z(e),e=f.next,s=f.next;else if((e=f)===s){i?1===i?c(e=y(l(e),n,t),n,t,r,o,x,2):2===i&&p(e,n,t,r,o,x):c(l(e),n,t,r,o,x,1);break}}}function v(e){var n=e.prev,t=e,r=e.next;if(M(n,t,r)>=0)return!1;for(var o=e.next.next;o!==e.prev;){if(m(n.x,n.y,t.x,t.y,r.x,r.y,o.x,o.y)&&M(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function h(e,n,t,r){var o=e.prev,x=e,i=e.next;if(M(o,x,i)>=0)return!1;for(var u=o.x<x.x?o.x<i.x?o.x:i.x:x.x<i.x?x.x:i.x,f=o.y<x.y?o.y<i.y?o.y:i.y:x.y<i.y?x.y:i.y,s=o.x>x.x?o.x>i.x?o.x:i.x:x.x>i.x?x.x:i.x,a=o.y>x.y?o.y>i.y?o.y:i.y:x.y>i.y?x.y:i.y,l=w(u,f,n,t,r),c=w(s,a,n,t,r),v=e.prevZ,h=e.nextZ;v&&v.z>=l&&h&&h.z<=c;){if(v!==e.prev&&v!==e.next&&m(o.x,o.y,x.x,x.y,i.x,i.y,v.x,v.y)&&M(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,h!==e.prev&&h!==e.next&&m(o.x,o.y,x.x,x.y,i.x,i.y,h.x,h.y)&&M(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;v&&v.z>=l;){if(v!==e.prev&&v!==e.next&&m(o.x,o.y,x.x,x.y,i.x,i.y,v.x,v.y)&&M(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;h&&h.z<=c;){if(h!==e.prev&&h!==e.next&&m(o.x,o.y,x.x,x.y,i.x,i.y,h.x,h.y)&&M(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function y(e,n,t){var r=e;do{var o=r.prev,x=r.next.next;!E(o,x)&&O(o,r,r.next,x)&&P(o,x)&&P(x,o)&&(n.push(o.i/t),n.push(r.i/t),n.push(x.i/t),z(r),z(r.next),r=e=x),r=r.next}while(r!==e);return l(r)}function p(e,n,t,r,o,x){var i=e;do{for(var u=i.next.next;u!==i.prev;){if(i.i!==u.i&&A(i,u)){var f=_(i,u);return i=l(i,i.next),f=l(f,f.next),c(i,n,t,r,o,x),void c(f,n,t,r,o,x)}u=u.next}i=i.next}while(i!==e)}function d(e,n){return e.x-n.x}function g(e,n){var t=function(e,n){var t,r=n,o=e.x,x=e.y,i=-1/0;do{if(x<=r.y&&x>=r.next.y&&r.next.y!==r.y){var u=r.x+(x-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=o&&u>i){if(i=u,u===o){if(x===r.y)return r;if(x===r.next.y)return r.next}t=r.x<r.next.x?r:r.next}}r=r.next}while(r!==n);if(!t)return null;if(o===i)return t;var f,s=t,a=t.x,l=t.y,c=1/0;r=t;do{o>=r.x&&r.x>=a&&o!==r.x&&m(x<l?o:i,x,a,l,x<l?i:o,x,r.x,r.y)&&(f=Math.abs(x-r.y)/(o-r.x),P(r,e)&&(f<c||f===c&&(r.x>t.x||r.x===t.x&&b(t,r)))&&(t=r,c=f)),r=r.next}while(r!==s);return t}(e,n);if(!t)return n;var r=_(t,e),o=l(t,t.next);return l(r,r.next),n===t?o:n}function b(e,n){return M(e.prev,e,n.prev)<0&&M(n.next,e,e.next)<0}function w(e,n,t,r,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-t)*o)|e<<8))|e<<4))|e<<2))|e<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-r)*o)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function Z(e){var n=e,t=e;do{(n.x<t.x||n.x===t.x&&n.y<t.y)&&(t=n),n=n.next}while(n!==e);return t}function m(e,n,t,r,o,x,i,u){return(o-i)*(n-u)-(e-i)*(x-u)>=0&&(e-i)*(r-u)-(t-i)*(n-u)>=0&&(t-i)*(x-u)-(o-i)*(r-u)>=0}function A(e,n){return e.next.i!==n.i&&e.prev.i!==n.i&&!function(e,n){var t=e;do{if(t.i!==e.i&&t.next.i!==e.i&&t.i!==n.i&&t.next.i!==n.i&&O(t,t.next,e,n))return!0;t=t.next}while(t!==e);return!1}(e,n)&&(P(e,n)&&P(n,e)&&function(e,n){var t=e,r=!1,o=(e.x+n.x)/2,x=(e.y+n.y)/2;do{t.y>x!=t.next.y>x&&t.next.y!==t.y&&o<(t.next.x-t.x)*(x-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next}while(t!==e);return r}(e,n)&&(M(e.prev,e,n.prev)||M(e,n.prev,n))||E(e,n)&&M(e.prev,e,e.next)>0&&M(n.prev,n,n.next)>0)}function M(e,n,t){return(n.y-e.y)*(t.x-n.x)-(n.x-e.x)*(t.y-n.y)}function E(e,n){return e.x===n.x&&e.y===n.y}function O(e,n,t,r){var o=I(M(e,n,t)),x=I(M(e,n,r)),i=I(M(t,r,e)),u=I(M(t,r,n));return o!==x&&i!==u||(!(0!==o||!F(e,t,n))||(!(0!==x||!F(e,r,n))||(!(0!==i||!F(t,e,r))||!(0!==u||!F(t,n,r)))))}function F(e,n,t){return n.x<=Math.max(e.x,t.x)&&n.x>=Math.min(e.x,t.x)&&n.y<=Math.max(e.y,t.y)&&n.y>=Math.min(e.y,t.y)}function I(e){return e>0?1:e<0?-1:0}function P(e,n){return M(e.prev,e,e.next)<0?M(e,n,e.next)>=0&&M(e,e.prev,n)>=0:M(e,n,e.prev)<0||M(e,e.next,n)<0}function _(e,n){var t=new B(e.i,e.x,e.y),r=new B(n.i,n.x,n.y),o=e.next,x=n.prev;return e.next=n,n.prev=e,t.next=o,o.prev=t,r.next=t,t.prev=r,x.next=r,r.prev=x,r}function k(e,n,t,r){var o=new B(e,n,t);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 B(e,n,t){this.i=e,this.x=n,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function G(e,n,t,r){for(var o=0,x=n,i=t-r;x<t;x+=r)o+=(e[i]-e[x])*(e[x+1]+e[i+1]),i=x;return o}f.exports=s,f.exports.default=s,s.deviation=function(e,n,t,r){var o=n&&n.length,x=o?n[0]*t:e.length,i=Math.abs(G(e,0,x,t));if(o)for(var u=0,f=n.length;u<f;u++){var s=n[u]*t,a=u<f-1?n[u+1]*t:e.length;i-=Math.abs(G(e,s,a,t))}var l=0;for(u=0;u<r.length;u+=3){var c=r[u]*t,v=r[u+1]*t,h=r[u+2]*t;l+=Math.abs((e[c]-e[h])*(e[v+1]-e[c+1])-(e[c]-e[v])*(e[h+1]-e[c+1]))}return 0===i&&0===l?0:Math.abs((l-i)/i)},s.flatten=function(e){for(var n=e[0][0].length,t={vertices:[],holes:[],dimensions:n},r=0,o=0;o<e.length;o++){for(var x=0;x<e[o].length;x++)for(var i=0;i<n;i++)t.vertices.push(e[o][x][i]);o>0&&(r+=e[o-1].length,t.holes.push(r))}return t};const N=[],R={vertexPosition:0,indexPosition:0};function S(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function T(e,n,t,r,o,x){const i=3+o,u=e[n+0],f=e[n+1],s=N;s.length=o;for(let t=0;t<s.length;t++)s[t]=e[n+2+t];let a=x?x.vertexPosition:0,l=x?x.indexPosition:0;const c=a/i;return S(t,a,u,f,0),s.length&&t.set(s,a+3),a+=i,S(t,a,u,f,1),s.length&&t.set(s,a+3),a+=i,S(t,a,u,f,2),s.length&&t.set(s,a+3),a+=i,S(t,a,u,f,3),s.length&&t.set(s,a+3),a+=i,r[l++]=c,r[l++]=c+1,r[l++]=c+3,r[l++]=c+1,r[l++]=c+2,r[l++]=c+3,R.vertexPosition=a,R.indexPosition=l,R}function C(e,n,t,r,o,x,u,f,s,a){const l=5+f.length,c=x.length/l,v=[e[n+0],e[n+1]],h=[e[t],e[t+1]],y=i(a,[...v]),p=i(a,[...h]);function d(e,n,t){const r=1e4;return Math.round(1500*n)+Math.round(1500*t)*r+e*r*r}function g(e,n,t){const r=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),o=[(n[0]-e[0])/r,(n[1]-e[1])/r],x=[-o[1],o[0]],i=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),u=[(t[0]-e[0])/i,(t[1]-e[1])/i],f=0===r||0===i?0:Math.acos((s=u[0]*o[0]+u[1]*o[1],a=-1,l=1,Math.min(Math.max(s,a),l)));var s,a,l;return u[0]*x[0]+u[1]*x[1]>0?f:2*Math.PI-f}const b=null!==o;let w=0,Z=0;if(null!==r){w=g(y,p,i(a,[...[e[r],e[r+1]]]))}if(b){Z=g(p,y,i(a,[...[e[o],e[o+1]]]))}x.push(v[0],v[1],h[0],h[1],d(0,w,Z)),x.push(...f),x.push(v[0],v[1],h[0],h[1],d(1,w,Z)),x.push(...f),x.push(v[0],v[1],h[0],h[1],d(2,w,Z)),x.push(...f),x.push(v[0],v[1],h[0],h[1],d(3,w,Z)),x.push(...f),u.push(c,c+1,c+2,c+1,c+3,c+2)}function U(e,n,t,r,o){const x=2+o;let i=n;const u=e.slice(i,i+o);i+=o;const s=e[i++];let a=0;const l=new Array(s-1);for(let n=0;n<s;n++)a+=e[i++],n<s-1&&(l[n]=a);const c=e.slice(i,i+2*a),v=f.exports(c,l,2);for(let e=0;e<v.length;e++)r.push(v[e]+t.length/x);for(let e=0;e<c.length;e+=2)t.push(c[e],c[e+1],...u);return i+2*a}const j=self;j.onmessage=o=>{const x=o.data;switch(x.type){case n:{const e=3,n=2,t=x.customAttributesCount,o=n+t,i=new Float32Array(x.renderInstructions),u=i.length/o,f=4*u*(t+e),s=new Uint32Array(6*u),a=new Float32Array(f);let l;for(let e=0;e<i.length;e+=o)l=T(i,e,a,s,t,l);const c=r({vertexBuffer:a.buffer,indexBuffer:s.buffer,renderInstructions:i.buffer},x);j.postMessage(c,[a.buffer,s.buffer,i.buffer]);break}case t:{const e=[],n=[],t=x.customAttributesCount,o=2,i=new Float32Array(x.renderInstructions);let f=0;const s=x.renderInstructionsTransform,a=[1,0,0,1,0,0];let l,c;for(u(a,s);f<i.length;){c=Array.from(i.slice(f,f+t)),f+=t,l=i[f++];for(let t=0;t<l-1;t++)C(i,f+t*o,f+(t+1)*o,t>0?f+(t-1)*o:null,t<l-2?f+(t+2)*o:null,e,n,c,0,a);f+=l*o}const v=Uint32Array.from(n),h=Float32Array.from(e),y=r({vertexBuffer:h.buffer,indexBuffer:v.buffer,renderInstructions:i.buffer},x);j.postMessage(y,[h.buffer,v.buffer,i.buffer]);break}case e:{const e=[],n=[],t=x.customAttributesCount,o=new Float32Array(x.renderInstructions);let i=0;for(;i<o.length;)i=U(o,i,e,n,t);const u=Uint32Array.from(n),f=Float32Array.from(e),s=r({vertexBuffer:f.buffer,indexBuffer:u.buffer,renderInstructions:o.buffer},x);j.postMessage(s,[f.buffer,u.buffer,o.buffer]);break}}};";
|
|
3
|
+
const source = "const e=\"GENERATE_POLYGON_BUFFERS\",n=\"GENERATE_POINT_BUFFERS\",t=\"GENERATE_LINE_STRING_BUFFERS\",r=\"undefined\"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():\"\";r.indexOf(\"firefox\");-1!==r.indexOf(\"safari\")&&-1==r.indexOf(\"chrom\")&&(r.indexOf(\"version/15.4\")>=0||r.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==r.indexOf(\"webkit\")&&r.indexOf(\"edge\"),r.indexOf(\"macintosh\"),\"undefined\"!=typeof WorkerGlobalScope&&\"undefined\"!=typeof OffscreenCanvas&&(self,WorkerGlobalScope),function(){let e=!1;try{const n=Object.defineProperty({},\"passive\",{get:function(){e=!0}});window.addEventListener(\"_\",null,n),window.removeEventListener(\"_\",null,n)}catch(e){}}();class x extends Error{constructor(e){const n=\"Assertion failed. See https://openlayers.org/en/latest/doc/errors/#\"+e+\" for details.\";super(n),this.code=e,this.name=\"AssertionError\",this.message=n}}function o(e,n){const t=n[0],r=n[1];return n[0]=e[0]*t+e[2]*r+e[4],n[1]=e[1]*t+e[3]*r+e[5],n}function i(e,n){const t=(r=n)[0]*r[3]-r[1]*r[2];var r;!function(e,n){if(!e)throw new x(n)}(0!==t,32);const o=n[0],i=n[1],u=n[2],f=n[3],s=n[4],a=n[5];return e[0]=f/t,e[1]=-i/t,e[2]=-u/t,e[3]=o/t,e[4]=(u*a-f*s)/t,e[5]=-(o*a-i*s)/t,e}new Array(6);var u={exports:{}};function f(e,n,t){t=t||2;var r,x,o,i,u,f,v,c=n&&n.length,h=c?n[0]*t:e.length,y=s(e,0,h,t,!0),g=[];if(!y||y.next===y.prev)return g;if(c&&(y=function(e,n,t,r){var x,o,i,u=[];for(x=0,o=n.length;x<o;x++)(i=s(e,n[x]*r,x<o-1?n[x+1]*r:e.length,r,!1))===i.next&&(i.steiner=!0),u.push(w(i));for(u.sort(p),x=0;x<u.length;x++)t=a(t=d(u[x],t),t.next);return t}(e,n,y,t)),e.length>80*t){r=o=e[0],x=i=e[1];for(var b=t;b<h;b+=t)(u=e[b])<r&&(r=u),(f=e[b+1])<x&&(x=f),u>o&&(o=u),f>i&&(i=f);v=0!==(v=Math.max(o-r,i-x))?1/v:0}return l(y,g,t,r,x,v),g}function s(e,n,t,r,x){var o,i;if(x===B(e,n,t,r)>0)for(o=n;o<t;o+=r)i=_(o,e[o],e[o+1],i);else for(o=t-r;o>=n;o-=r)i=_(o,e[o],e[o+1],i);return i&&M(i,i.next)&&(k(i),i=i.next),i}function a(e,n){if(!e)return e;n||(n=e);var t,r=e;do{if(t=!1,r.steiner||!M(r,r.next)&&0!==A(r.prev,r,r.next))r=r.next;else{if(k(r),(r=n=r.prev)===r.next)break;t=!0}}while(t||r!==n);return n}function l(e,n,t,r,x,o,i){if(e){!i&&o&&function(e,n,t,r){var x=e;do{null===x.z&&(x.z=b(x.x,x.y,n,t,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==e);x.prevZ.nextZ=null,x.prevZ=null,function(e){var n,t,r,x,o,i,u,f,s=1;do{for(t=e,e=null,o=null,i=0;t;){for(i++,r=t,u=0,n=0;n<s&&(u++,r=r.nextZ);n++);for(f=s;u>0||f>0&&r;)0!==u&&(0===f||!r||t.z<=r.z)?(x=t,t=t.nextZ,u--):(x=r,r=r.nextZ,f--),o?o.nextZ=x:e=x,x.prevZ=o,o=x;t=r}o.nextZ=null,s*=2}while(i>1)}(x)}(e,r,x,o);for(var u,f,s=e;e.prev!==e.next;)if(u=e.prev,f=e.next,o?c(e,r,x,o):v(e))n.push(u.i/t),n.push(e.i/t),n.push(f.i/t),k(e),e=f.next,s=f.next;else if((e=f)===s){i?1===i?l(e=h(a(e),n,t),n,t,r,x,o,2):2===i&&y(e,n,t,r,x,o):l(a(e),n,t,r,x,o,1);break}}}function v(e){var n=e.prev,t=e,r=e.next;if(A(n,t,r)>=0)return!1;for(var x=e.next.next;x!==e.prev;){if(Z(n.x,n.y,t.x,t.y,r.x,r.y,x.x,x.y)&&A(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function c(e,n,t,r){var x=e.prev,o=e,i=e.next;if(A(x,o,i)>=0)return!1;for(var u=x.x<o.x?x.x<i.x?x.x:i.x:o.x<i.x?o.x:i.x,f=x.y<o.y?x.y<i.y?x.y:i.y:o.y<i.y?o.y:i.y,s=x.x>o.x?x.x>i.x?x.x:i.x:o.x>i.x?o.x:i.x,a=x.y>o.y?x.y>i.y?x.y:i.y:o.y>i.y?o.y:i.y,l=b(u,f,n,t,r),v=b(s,a,n,t,r),c=e.prevZ,h=e.nextZ;c&&c.z>=l&&h&&h.z<=v;){if(c!==e.prev&&c!==e.next&&Z(x.x,x.y,o.x,o.y,i.x,i.y,c.x,c.y)&&A(c.prev,c,c.next)>=0)return!1;if(c=c.prevZ,h!==e.prev&&h!==e.next&&Z(x.x,x.y,o.x,o.y,i.x,i.y,h.x,h.y)&&A(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;c&&c.z>=l;){if(c!==e.prev&&c!==e.next&&Z(x.x,x.y,o.x,o.y,i.x,i.y,c.x,c.y)&&A(c.prev,c,c.next)>=0)return!1;c=c.prevZ}for(;h&&h.z<=v;){if(h!==e.prev&&h!==e.next&&Z(x.x,x.y,o.x,o.y,i.x,i.y,h.x,h.y)&&A(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function h(e,n,t){var r=e;do{var x=r.prev,o=r.next.next;!M(x,o)&&E(x,r,r.next,o)&&I(x,o)&&I(o,x)&&(n.push(x.i/t),n.push(r.i/t),n.push(o.i/t),k(r),k(r.next),r=e=o),r=r.next}while(r!==e);return a(r)}function y(e,n,t,r,x,o){var i=e;do{for(var u=i.next.next;u!==i.prev;){if(i.i!==u.i&&m(i,u)){var f=P(i,u);return i=a(i,i.next),f=a(f,f.next),l(i,n,t,r,x,o),void l(f,n,t,r,x,o)}u=u.next}i=i.next}while(i!==e)}function p(e,n){return e.x-n.x}function d(e,n){var t=function(e,n){var t,r=n,x=e.x,o=e.y,i=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var u=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=x&&u>i){if(i=u,u===x){if(o===r.y)return r;if(o===r.next.y)return r.next}t=r.x<r.next.x?r:r.next}}r=r.next}while(r!==n);if(!t)return null;if(x===i)return t;var f,s=t,a=t.x,l=t.y,v=1/0;r=t;do{x>=r.x&&r.x>=a&&x!==r.x&&Z(o<l?x:i,o,a,l,o<l?i:x,o,r.x,r.y)&&(f=Math.abs(o-r.y)/(x-r.x),I(r,e)&&(f<v||f===v&&(r.x>t.x||r.x===t.x&&g(t,r)))&&(t=r,v=f)),r=r.next}while(r!==s);return t}(e,n);if(!t)return n;var r=P(t,e),x=a(t,t.next);return a(r,r.next),n===t?x:n}function g(e,n){return A(e.prev,e,n.prev)<0&&A(n.next,e,e.next)<0}function b(e,n,t,r,x){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-t)*x)|e<<8))|e<<4))|e<<2))|e<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-r)*x)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function w(e){var n=e,t=e;do{(n.x<t.x||n.x===t.x&&n.y<t.y)&&(t=n),n=n.next}while(n!==e);return t}function Z(e,n,t,r,x,o,i,u){return(x-i)*(n-u)-(e-i)*(o-u)>=0&&(e-i)*(r-u)-(t-i)*(n-u)>=0&&(t-i)*(o-u)-(x-i)*(r-u)>=0}function m(e,n){return e.next.i!==n.i&&e.prev.i!==n.i&&!function(e,n){var t=e;do{if(t.i!==e.i&&t.next.i!==e.i&&t.i!==n.i&&t.next.i!==n.i&&E(t,t.next,e,n))return!0;t=t.next}while(t!==e);return!1}(e,n)&&(I(e,n)&&I(n,e)&&function(e,n){var t=e,r=!1,x=(e.x+n.x)/2,o=(e.y+n.y)/2;do{t.y>o!=t.next.y>o&&t.next.y!==t.y&&x<(t.next.x-t.x)*(o-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next}while(t!==e);return r}(e,n)&&(A(e.prev,e,n.prev)||A(e,n.prev,n))||M(e,n)&&A(e.prev,e,e.next)>0&&A(n.prev,n,n.next)>0)}function A(e,n,t){return(n.y-e.y)*(t.x-n.x)-(n.x-e.x)*(t.y-n.y)}function M(e,n){return e.x===n.x&&e.y===n.y}function E(e,n,t,r){var x=F(A(e,n,t)),o=F(A(e,n,r)),i=F(A(t,r,e)),u=F(A(t,r,n));return x!==o&&i!==u||(!(0!==x||!O(e,t,n))||(!(0!==o||!O(e,r,n))||(!(0!==i||!O(t,e,r))||!(0!==u||!O(t,n,r)))))}function O(e,n,t){return n.x<=Math.max(e.x,t.x)&&n.x>=Math.min(e.x,t.x)&&n.y<=Math.max(e.y,t.y)&&n.y>=Math.min(e.y,t.y)}function F(e){return e>0?1:e<0?-1:0}function I(e,n){return A(e.prev,e,e.next)<0?A(e,n,e.next)>=0&&A(e,e.prev,n)>=0:A(e,n,e.prev)<0||A(e,e.next,n)<0}function P(e,n){var t=new z(e.i,e.x,e.y),r=new z(n.i,n.x,n.y),x=e.next,o=n.prev;return e.next=n,n.prev=e,t.next=x,x.prev=t,r.next=t,t.prev=r,o.next=r,r.prev=o,r}function _(e,n,t,r){var x=new z(e,n,t);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function k(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 z(e,n,t){this.i=e,this.x=n,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function B(e,n,t,r){for(var x=0,o=n,i=t-r;o<t;o+=r)x+=(e[i]-e[o])*(e[o+1]+e[i+1]),i=o;return x}u.exports=f,u.exports.default=f,f.deviation=function(e,n,t,r){var x=n&&n.length,o=x?n[0]*t:e.length,i=Math.abs(B(e,0,o,t));if(x)for(var u=0,f=n.length;u<f;u++){var s=n[u]*t,a=u<f-1?n[u+1]*t:e.length;i-=Math.abs(B(e,s,a,t))}var l=0;for(u=0;u<r.length;u+=3){var v=r[u]*t,c=r[u+1]*t,h=r[u+2]*t;l+=Math.abs((e[v]-e[h])*(e[c+1]-e[v+1])-(e[v]-e[c])*(e[h+1]-e[v+1]))}return 0===i&&0===l?0:Math.abs((l-i)/i)},f.flatten=function(e){for(var n=e[0][0].length,t={vertices:[],holes:[],dimensions:n},r=0,x=0;x<e.length;x++){for(var o=0;o<e[x].length;o++)for(var i=0;i<n;i++)t.vertices.push(e[x][o][i]);x>0&&(r+=e[x-1].length,t.holes.push(r))}return t};const G=[],N={vertexPosition:0,indexPosition:0};function R(e,n,t,r,x){e[n+0]=t,e[n+1]=r,e[n+2]=x}function S(e,n,t,r,x,o){const i=3+x,u=e[n+0],f=e[n+1],s=G;s.length=x;for(let t=0;t<s.length;t++)s[t]=e[n+2+t];let a=o?o.vertexPosition:0,l=o?o.indexPosition:0;const v=a/i;return R(t,a,u,f,0),s.length&&t.set(s,a+3),a+=i,R(t,a,u,f,1),s.length&&t.set(s,a+3),a+=i,R(t,a,u,f,2),s.length&&t.set(s,a+3),a+=i,R(t,a,u,f,3),s.length&&t.set(s,a+3),a+=i,r[l++]=v,r[l++]=v+1,r[l++]=v+3,r[l++]=v+1,r[l++]=v+2,r[l++]=v+3,N.vertexPosition=a,N.indexPosition=l,N}function T(e,n,t,r,x,i,u,f,s,a){const l=5+f.length,v=i.length/l,c=[e[n+0],e[n+1]],h=[e[t],e[t+1]],y=o(a,[...c]),p=o(a,[...h]);function d(e,n,t){const r=1e4;return Math.round(1500*n)+Math.round(1500*t)*r+e*r*r}function g(e,n,t){const r=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),x=[(n[0]-e[0])/r,(n[1]-e[1])/r],o=[-x[1],x[0]],i=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),u=[(t[0]-e[0])/i,(t[1]-e[1])/i],f=0===r||0===i?0:Math.acos((s=u[0]*x[0]+u[1]*x[1],a=-1,l=1,Math.min(Math.max(s,a),l)));var s,a,l;return u[0]*o[0]+u[1]*o[1]>0?f:2*Math.PI-f}const b=null!==x;let w=0,Z=0;if(null!==r){w=g(y,p,o(a,[...[e[r],e[r+1]]]))}if(b){Z=g(p,y,o(a,[...[e[x],e[x+1]]]))}i.push(c[0],c[1],h[0],h[1],d(0,w,Z)),i.push(...f),i.push(c[0],c[1],h[0],h[1],d(1,w,Z)),i.push(...f),i.push(c[0],c[1],h[0],h[1],d(2,w,Z)),i.push(...f),i.push(c[0],c[1],h[0],h[1],d(3,w,Z)),i.push(...f),u.push(v,v+1,v+2,v+1,v+3,v+2)}function U(e,n,t,r,x){const o=2+x;let i=n;const f=e.slice(i,i+x);i+=x;const s=e[i++];let a=0;const l=new Array(s-1);for(let n=0;n<s;n++)a+=e[i++],n<s-1&&(l[n]=a);const v=e.slice(i,i+2*a),c=u.exports(v,l,2);for(let e=0;e<c.length;e++)r.push(c[e]+t.length/o);for(let e=0;e<v.length;e+=2)t.push(v[e],v[e+1],...f);return i+2*a}const C=self;C.onmessage=r=>{const x=r.data;switch(x.type){case n:{const e=3,n=2,t=x.customAttributesCount,r=n+t,o=new Float32Array(x.renderInstructions),i=o.length/r,u=4*i*(t+e),f=new Uint32Array(6*i),s=new Float32Array(u);let a;for(let e=0;e<o.length;e+=r)a=S(o,e,s,f,t,a);const l=Object.assign({vertexBuffer:s.buffer,indexBuffer:f.buffer,renderInstructions:o.buffer},x);C.postMessage(l,[s.buffer,f.buffer,o.buffer]);break}case t:{const e=[],n=[],t=x.customAttributesCount,r=2,o=new Float32Array(x.renderInstructions);let u=0;const f=x.renderInstructionsTransform,s=[1,0,0,1,0,0];let a,l;for(i(s,f);u<o.length;){l=Array.from(o.slice(u,u+t)),u+=t,a=o[u++];for(let t=0;t<a-1;t++)T(o,u+t*r,u+(t+1)*r,t>0?u+(t-1)*r:null,t<a-2?u+(t+2)*r:null,e,n,l,0,s);u+=a*r}const v=Uint32Array.from(n),c=Float32Array.from(e),h=Object.assign({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:o.buffer},x);C.postMessage(h,[c.buffer,v.buffer,o.buffer]);break}case e:{const e=[],n=[],t=x.customAttributesCount,r=new Float32Array(x.renderInstructions);let o=0;for(;o<r.length;)o=U(r,o,e,n,t);const i=Uint32Array.from(n),u=Float32Array.from(e),f=Object.assign({vertexBuffer:u.buffer,indexBuffer:i.buffer,renderInstructions:r.buffer},x);C.postMessage(f,[u.buffer,i.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'})));
|
package/util.js
CHANGED
package/webgl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl.d.ts","sourceRoot":"","sources":["src/webgl.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgl.d.ts","sourceRoot":"","sources":["src/webgl.js"],"names":[],"mappings":"AAuFA;;;;GAIG;AACH,mCAJW,iBAAiB,yBAEhB,qBAAqB,CAsBhC;AAOD;;GAEG;AACH,0CAFY,MAAM,MAAM,CAAC,CAWxB;AA7HD;;GAEG;AAEH;;;;;;;GAOG;AACH,2BAHU,MAAM,CAGmB;AAEnC;;;;;;;GAOG;AACH,mCAHU,MAAM,CAG2B;AAE3C;;;;;GAKG;AACH,0BAHU,MAAM,CAGkB;AAElC;;;;;GAKG;AACH,0BAHU,MAAM,CAGkB;AAElC;;;;;GAKG;AACH,2BAHU,MAAM,CAGmB;AAEnC;;;GAGG;AACH,4BAFU,MAAM,CAEoB;AAEpC;;;GAGG;AACH,6BAFU,MAAM,CAEqB;AAErC;;;GAGG;AACH,2BAFU,MAAM,CAEmB;AAEnC;;;GAGG;AACH,oBAFU,MAAM,CAEY"}
|
package/webgl.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* @module ol/webgl
|
|
3
3
|
*/
|
|
4
4
|
import { SAFARI_BUG_237906 } from './has.js';
|
|
5
|
-
import { assign } from './obj.js';
|
|
6
5
|
/**
|
|
7
6
|
* Constants taken from goog.webgl
|
|
8
7
|
*/
|
|
@@ -78,7 +77,7 @@ var CONTEXT_IDS = ['experimental-webgl', 'webgl', 'webkit-3d', 'moz-webgl'];
|
|
|
78
77
|
* @return {WebGLRenderingContext} WebGL rendering context.
|
|
79
78
|
*/
|
|
80
79
|
export function getContext(canvas, opt_attributes) {
|
|
81
|
-
var attributes = assign({
|
|
80
|
+
var attributes = Object.assign({
|
|
82
81
|
preserveDrawingBuffer: true,
|
|
83
82
|
antialias: SAFARI_BUG_237906 ? false : true, // https://bugs.webkit.org/show_bug.cgi?id=237906
|
|
84
83
|
}, opt_attributes);
|
package/webgl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl.js","sourceRoot":"","sources":["src/webgl.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"webgl.js","sourceRoot":"","sources":["src/webgl.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAE3C;;GAEG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,IAAM,YAAY,GAAG,MAAM,CAAC;AAEnC;;;;;;;GAOG;AACH,MAAM,CAAC,IAAM,oBAAoB,GAAG,MAAM,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,CAAC,IAAM,WAAW,GAAG,MAAM,CAAC;AAElC;;;;;GAKG;AACH,MAAM,CAAC,IAAM,WAAW,GAAG,MAAM,CAAC;AAElC;;;;;GAKG;AACH,MAAM,CAAC,IAAM,YAAY,GAAG,MAAM,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,IAAM,aAAa,GAAG,MAAM,CAAC;AAEpC;;;GAGG;AACH,MAAM,CAAC,IAAM,cAAc,GAAG,MAAM,CAAC;AAErC;;;GAGG;AACH,MAAM,CAAC,IAAM,YAAY,GAAG,MAAM,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,IAAM,KAAK,GAAG,MAAM,CAAC;AAE5B;GACG;AAEH;;;GAGG;AACH,IAAM,WAAW,GAAG,CAAC,oBAAoB,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AAE9E;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAM,EAAE,cAAc;IAC/C,IAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAC9B;QACE,qBAAqB,EAAE,IAAI;QAC3B,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,iDAAiD;KAC/F,EACD,cAAc,CACf,CAAC;IACF,IAAM,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC;IAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;QAC3B,IAAI;YACF,IAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;YAC9D,IAAI,OAAO,EAAE;gBACX,OAAO,qCAAqC,CAAC,CAAC,OAAO,CAAC,CAAC;aACxD;SACF;QAAC,OAAO,CAAC,EAAE;YACV,OAAO;SACR;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,IAAI,mBAAmB,CAAC;AAExB;;GAEG;AACH,MAAM,UAAU,sBAAsB;IACpC,IAAI,CAAC,mBAAmB,EAAE;QACxB,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,IAAM,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,EAAE,EAAE;YACN,mBAAmB,GAAG,EAAE,CAAC,sBAAsB,EAAE,CAAC;SACnD;KACF;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC"}
|
package/worker/webgl.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function create() {
|
|
2
|
-
var source = "const e=\"GENERATE_POLYGON_BUFFERS\",n=\"GENERATE_POINT_BUFFERS\",t=\"GENERATE_LINE_STRING_BUFFERS\",r=\"function\"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError(\"Cannot convert undefined or null to object\");const t=Object(e);for(let e=1,n=arguments.length;e<n;++e){const n=arguments[e];if(null!=n)for(const e in n)n.hasOwnProperty(e)&&(t[e]=n[e])}return t},o=\"undefined\"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():\"\";o.indexOf(\"firefox\");-1!==o.indexOf(\"safari\")&&-1==o.indexOf(\"chrom\")&&(o.indexOf(\"version/15.4\")>=0||o.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==o.indexOf(\"webkit\")&&o.indexOf(\"edge\"),o.indexOf(\"macintosh\"),\"undefined\"!=typeof WorkerGlobalScope&&\"undefined\"!=typeof OffscreenCanvas&&(self,WorkerGlobalScope),function(){let e=!1;try{const n=Object.defineProperty({},\"passive\",{get:function(){e=!0}});window.addEventListener(\"_\",null,n),window.removeEventListener(\"_\",null,n)}catch(e){}}();class x extends Error{constructor(e){const n=\"Assertion failed. See https://openlayers.org/en/latest/doc/errors/#\"+e+\" for details.\";super(n),this.code=e,this.name=\"AssertionError\",this.message=n}}function i(e,n){const t=n[0],r=n[1];return n[0]=e[0]*t+e[2]*r+e[4],n[1]=e[1]*t+e[3]*r+e[5],n}function u(e,n){const t=(r=n)[0]*r[3]-r[1]*r[2];var r;!function(e,n){if(!e)throw new x(n)}(0!==t,32);const o=n[0],i=n[1],u=n[2],f=n[3],s=n[4],a=n[5];return e[0]=f/t,e[1]=-i/t,e[2]=-u/t,e[3]=o/t,e[4]=(u*a-f*s)/t,e[5]=-(o*a-i*s)/t,e}new Array(6);var f={exports:{}};function s(e,n,t){t=t||2;var r,o,x,i,u,f,s,v=n&&n.length,h=v?n[0]*t:e.length,y=a(e,0,h,t,!0),p=[];if(!y||y.next===y.prev)return p;if(v&&(y=function(e,n,t,r){var o,x,i,u=[];for(o=0,x=n.length;o<x;o++)(i=a(e,n[o]*r,o<x-1?n[o+1]*r:e.length,r,!1))===i.next&&(i.steiner=!0),u.push(Z(i));for(u.sort(d),o=0;o<u.length;o++)t=l(t=g(u[o],t),t.next);return t}(e,n,y,t)),e.length>80*t){r=x=e[0],o=i=e[1];for(var b=t;b<h;b+=t)(u=e[b])<r&&(r=u),(f=e[b+1])<o&&(o=f),u>x&&(x=u),f>i&&(i=f);s=0!==(s=Math.max(x-r,i-o))?1/s:0}return c(y,p,t,r,o,s),p}function a(e,n,t,r,o){var x,i;if(o===G(e,n,t,r)>0)for(x=n;x<t;x+=r)i=k(x,e[x],e[x+1],i);else for(x=t-r;x>=n;x-=r)i=k(x,e[x],e[x+1],i);return i&&E(i,i.next)&&(z(i),i=i.next),i}function l(e,n){if(!e)return e;n||(n=e);var t,r=e;do{if(t=!1,r.steiner||!E(r,r.next)&&0!==M(r.prev,r,r.next))r=r.next;else{if(z(r),(r=n=r.prev)===r.next)break;t=!0}}while(t||r!==n);return n}function c(e,n,t,r,o,x,i){if(e){!i&&x&&function(e,n,t,r){var o=e;do{null===o.z&&(o.z=w(o.x,o.y,n,t,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 n,t,r,o,x,i,u,f,s=1;do{for(t=e,e=null,x=null,i=0;t;){for(i++,r=t,u=0,n=0;n<s&&(u++,r=r.nextZ);n++);for(f=s;u>0||f>0&&r;)0!==u&&(0===f||!r||t.z<=r.z)?(o=t,t=t.nextZ,u--):(o=r,r=r.nextZ,f--),x?x.nextZ=o:e=o,o.prevZ=x,x=o;t=r}x.nextZ=null,s*=2}while(i>1)}(o)}(e,r,o,x);for(var u,f,s=e;e.prev!==e.next;)if(u=e.prev,f=e.next,x?h(e,r,o,x):v(e))n.push(u.i/t),n.push(e.i/t),n.push(f.i/t),z(e),e=f.next,s=f.next;else if((e=f)===s){i?1===i?c(e=y(l(e),n,t),n,t,r,o,x,2):2===i&&p(e,n,t,r,o,x):c(l(e),n,t,r,o,x,1);break}}}function v(e){var n=e.prev,t=e,r=e.next;if(M(n,t,r)>=0)return!1;for(var o=e.next.next;o!==e.prev;){if(m(n.x,n.y,t.x,t.y,r.x,r.y,o.x,o.y)&&M(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function h(e,n,t,r){var o=e.prev,x=e,i=e.next;if(M(o,x,i)>=0)return!1;for(var u=o.x<x.x?o.x<i.x?o.x:i.x:x.x<i.x?x.x:i.x,f=o.y<x.y?o.y<i.y?o.y:i.y:x.y<i.y?x.y:i.y,s=o.x>x.x?o.x>i.x?o.x:i.x:x.x>i.x?x.x:i.x,a=o.y>x.y?o.y>i.y?o.y:i.y:x.y>i.y?x.y:i.y,l=w(u,f,n,t,r),c=w(s,a,n,t,r),v=e.prevZ,h=e.nextZ;v&&v.z>=l&&h&&h.z<=c;){if(v!==e.prev&&v!==e.next&&m(o.x,o.y,x.x,x.y,i.x,i.y,v.x,v.y)&&M(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,h!==e.prev&&h!==e.next&&m(o.x,o.y,x.x,x.y,i.x,i.y,h.x,h.y)&&M(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;v&&v.z>=l;){if(v!==e.prev&&v!==e.next&&m(o.x,o.y,x.x,x.y,i.x,i.y,v.x,v.y)&&M(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;h&&h.z<=c;){if(h!==e.prev&&h!==e.next&&m(o.x,o.y,x.x,x.y,i.x,i.y,h.x,h.y)&&M(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function y(e,n,t){var r=e;do{var o=r.prev,x=r.next.next;!E(o,x)&&O(o,r,r.next,x)&&P(o,x)&&P(x,o)&&(n.push(o.i/t),n.push(r.i/t),n.push(x.i/t),z(r),z(r.next),r=e=x),r=r.next}while(r!==e);return l(r)}function p(e,n,t,r,o,x){var i=e;do{for(var u=i.next.next;u!==i.prev;){if(i.i!==u.i&&A(i,u)){var f=_(i,u);return i=l(i,i.next),f=l(f,f.next),c(i,n,t,r,o,x),void c(f,n,t,r,o,x)}u=u.next}i=i.next}while(i!==e)}function d(e,n){return e.x-n.x}function g(e,n){var t=function(e,n){var t,r=n,o=e.x,x=e.y,i=-1/0;do{if(x<=r.y&&x>=r.next.y&&r.next.y!==r.y){var u=r.x+(x-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=o&&u>i){if(i=u,u===o){if(x===r.y)return r;if(x===r.next.y)return r.next}t=r.x<r.next.x?r:r.next}}r=r.next}while(r!==n);if(!t)return null;if(o===i)return t;var f,s=t,a=t.x,l=t.y,c=1/0;r=t;do{o>=r.x&&r.x>=a&&o!==r.x&&m(x<l?o:i,x,a,l,x<l?i:o,x,r.x,r.y)&&(f=Math.abs(x-r.y)/(o-r.x),P(r,e)&&(f<c||f===c&&(r.x>t.x||r.x===t.x&&b(t,r)))&&(t=r,c=f)),r=r.next}while(r!==s);return t}(e,n);if(!t)return n;var r=_(t,e),o=l(t,t.next);return l(r,r.next),n===t?o:n}function b(e,n){return M(e.prev,e,n.prev)<0&&M(n.next,e,e.next)<0}function w(e,n,t,r,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-t)*o)|e<<8))|e<<4))|e<<2))|e<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-r)*o)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function Z(e){var n=e,t=e;do{(n.x<t.x||n.x===t.x&&n.y<t.y)&&(t=n),n=n.next}while(n!==e);return t}function m(e,n,t,r,o,x,i,u){return(o-i)*(n-u)-(e-i)*(x-u)>=0&&(e-i)*(r-u)-(t-i)*(n-u)>=0&&(t-i)*(x-u)-(o-i)*(r-u)>=0}function A(e,n){return e.next.i!==n.i&&e.prev.i!==n.i&&!function(e,n){var t=e;do{if(t.i!==e.i&&t.next.i!==e.i&&t.i!==n.i&&t.next.i!==n.i&&O(t,t.next,e,n))return!0;t=t.next}while(t!==e);return!1}(e,n)&&(P(e,n)&&P(n,e)&&function(e,n){var t=e,r=!1,o=(e.x+n.x)/2,x=(e.y+n.y)/2;do{t.y>x!=t.next.y>x&&t.next.y!==t.y&&o<(t.next.x-t.x)*(x-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next}while(t!==e);return r}(e,n)&&(M(e.prev,e,n.prev)||M(e,n.prev,n))||E(e,n)&&M(e.prev,e,e.next)>0&&M(n.prev,n,n.next)>0)}function M(e,n,t){return(n.y-e.y)*(t.x-n.x)-(n.x-e.x)*(t.y-n.y)}function E(e,n){return e.x===n.x&&e.y===n.y}function O(e,n,t,r){var o=I(M(e,n,t)),x=I(M(e,n,r)),i=I(M(t,r,e)),u=I(M(t,r,n));return o!==x&&i!==u||(!(0!==o||!F(e,t,n))||(!(0!==x||!F(e,r,n))||(!(0!==i||!F(t,e,r))||!(0!==u||!F(t,n,r)))))}function F(e,n,t){return n.x<=Math.max(e.x,t.x)&&n.x>=Math.min(e.x,t.x)&&n.y<=Math.max(e.y,t.y)&&n.y>=Math.min(e.y,t.y)}function I(e){return e>0?1:e<0?-1:0}function P(e,n){return M(e.prev,e,e.next)<0?M(e,n,e.next)>=0&&M(e,e.prev,n)>=0:M(e,n,e.prev)<0||M(e,e.next,n)<0}function _(e,n){var t=new B(e.i,e.x,e.y),r=new B(n.i,n.x,n.y),o=e.next,x=n.prev;return e.next=n,n.prev=e,t.next=o,o.prev=t,r.next=t,t.prev=r,x.next=r,r.prev=x,r}function k(e,n,t,r){var o=new B(e,n,t);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 B(e,n,t){this.i=e,this.x=n,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function G(e,n,t,r){for(var o=0,x=n,i=t-r;x<t;x+=r)o+=(e[i]-e[x])*(e[x+1]+e[i+1]),i=x;return o}f.exports=s,f.exports.default=s,s.deviation=function(e,n,t,r){var o=n&&n.length,x=o?n[0]*t:e.length,i=Math.abs(G(e,0,x,t));if(o)for(var u=0,f=n.length;u<f;u++){var s=n[u]*t,a=u<f-1?n[u+1]*t:e.length;i-=Math.abs(G(e,s,a,t))}var l=0;for(u=0;u<r.length;u+=3){var c=r[u]*t,v=r[u+1]*t,h=r[u+2]*t;l+=Math.abs((e[c]-e[h])*(e[v+1]-e[c+1])-(e[c]-e[v])*(e[h+1]-e[c+1]))}return 0===i&&0===l?0:Math.abs((l-i)/i)},s.flatten=function(e){for(var n=e[0][0].length,t={vertices:[],holes:[],dimensions:n},r=0,o=0;o<e.length;o++){for(var x=0;x<e[o].length;x++)for(var i=0;i<n;i++)t.vertices.push(e[o][x][i]);o>0&&(r+=e[o-1].length,t.holes.push(r))}return t};const N=[],R={vertexPosition:0,indexPosition:0};function S(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function T(e,n,t,r,o,x){const i=3+o,u=e[n+0],f=e[n+1],s=N;s.length=o;for(let t=0;t<s.length;t++)s[t]=e[n+2+t];let a=x?x.vertexPosition:0,l=x?x.indexPosition:0;const c=a/i;return S(t,a,u,f,0),s.length&&t.set(s,a+3),a+=i,S(t,a,u,f,1),s.length&&t.set(s,a+3),a+=i,S(t,a,u,f,2),s.length&&t.set(s,a+3),a+=i,S(t,a,u,f,3),s.length&&t.set(s,a+3),a+=i,r[l++]=c,r[l++]=c+1,r[l++]=c+3,r[l++]=c+1,r[l++]=c+2,r[l++]=c+3,R.vertexPosition=a,R.indexPosition=l,R}function C(e,n,t,r,o,x,u,f,s,a){const l=5+f.length,c=x.length/l,v=[e[n+0],e[n+1]],h=[e[t],e[t+1]],y=i(a,[...v]),p=i(a,[...h]);function d(e,n,t){const r=1e4;return Math.round(1500*n)+Math.round(1500*t)*r+e*r*r}function g(e,n,t){const r=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),o=[(n[0]-e[0])/r,(n[1]-e[1])/r],x=[-o[1],o[0]],i=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),u=[(t[0]-e[0])/i,(t[1]-e[1])/i],f=0===r||0===i?0:Math.acos((s=u[0]*o[0]+u[1]*o[1],a=-1,l=1,Math.min(Math.max(s,a),l)));var s,a,l;return u[0]*x[0]+u[1]*x[1]>0?f:2*Math.PI-f}const b=null!==o;let w=0,Z=0;if(null!==r){w=g(y,p,i(a,[...[e[r],e[r+1]]]))}if(b){Z=g(p,y,i(a,[...[e[o],e[o+1]]]))}x.push(v[0],v[1],h[0],h[1],d(0,w,Z)),x.push(...f),x.push(v[0],v[1],h[0],h[1],d(1,w,Z)),x.push(...f),x.push(v[0],v[1],h[0],h[1],d(2,w,Z)),x.push(...f),x.push(v[0],v[1],h[0],h[1],d(3,w,Z)),x.push(...f),u.push(c,c+1,c+2,c+1,c+3,c+2)}function U(e,n,t,r,o){const x=2+o;let i=n;const u=e.slice(i,i+o);i+=o;const s=e[i++];let a=0;const l=new Array(s-1);for(let n=0;n<s;n++)a+=e[i++],n<s-1&&(l[n]=a);const c=e.slice(i,i+2*a),v=f.exports(c,l,2);for(let e=0;e<v.length;e++)r.push(v[e]+t.length/x);for(let e=0;e<c.length;e+=2)t.push(c[e],c[e+1],...u);return i+2*a}const j=self;j.onmessage=o=>{const x=o.data;switch(x.type){case n:{const e=3,n=2,t=x.customAttributesCount,o=n+t,i=new Float32Array(x.renderInstructions),u=i.length/o,f=4*u*(t+e),s=new Uint32Array(6*u),a=new Float32Array(f);let l;for(let e=0;e<i.length;e+=o)l=T(i,e,a,s,t,l);const c=r({vertexBuffer:a.buffer,indexBuffer:s.buffer,renderInstructions:i.buffer},x);j.postMessage(c,[a.buffer,s.buffer,i.buffer]);break}case t:{const e=[],n=[],t=x.customAttributesCount,o=2,i=new Float32Array(x.renderInstructions);let f=0;const s=x.renderInstructionsTransform,a=[1,0,0,1,0,0];let l,c;for(u(a,s);f<i.length;){c=Array.from(i.slice(f,f+t)),f+=t,l=i[f++];for(let t=0;t<l-1;t++)C(i,f+t*o,f+(t+1)*o,t>0?f+(t-1)*o:null,t<l-2?f+(t+2)*o:null,e,n,c,0,a);f+=l*o}const v=Uint32Array.from(n),h=Float32Array.from(e),y=r({vertexBuffer:h.buffer,indexBuffer:v.buffer,renderInstructions:i.buffer},x);j.postMessage(y,[h.buffer,v.buffer,i.buffer]);break}case e:{const e=[],n=[],t=x.customAttributesCount,o=new Float32Array(x.renderInstructions);let i=0;for(;i<o.length;)i=U(o,i,e,n,t);const u=Uint32Array.from(n),f=Float32Array.from(e),s=r({vertexBuffer:f.buffer,indexBuffer:u.buffer,renderInstructions:o.buffer},x);j.postMessage(s,[f.buffer,u.buffer,o.buffer]);break}}};";
|
|
2
|
+
var source = "const e=\"GENERATE_POLYGON_BUFFERS\",n=\"GENERATE_POINT_BUFFERS\",t=\"GENERATE_LINE_STRING_BUFFERS\",r=\"undefined\"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():\"\";r.indexOf(\"firefox\");-1!==r.indexOf(\"safari\")&&-1==r.indexOf(\"chrom\")&&(r.indexOf(\"version/15.4\")>=0||r.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==r.indexOf(\"webkit\")&&r.indexOf(\"edge\"),r.indexOf(\"macintosh\"),\"undefined\"!=typeof WorkerGlobalScope&&\"undefined\"!=typeof OffscreenCanvas&&(self,WorkerGlobalScope),function(){let e=!1;try{const n=Object.defineProperty({},\"passive\",{get:function(){e=!0}});window.addEventListener(\"_\",null,n),window.removeEventListener(\"_\",null,n)}catch(e){}}();class x extends Error{constructor(e){const n=\"Assertion failed. See https://openlayers.org/en/latest/doc/errors/#\"+e+\" for details.\";super(n),this.code=e,this.name=\"AssertionError\",this.message=n}}function o(e,n){const t=n[0],r=n[1];return n[0]=e[0]*t+e[2]*r+e[4],n[1]=e[1]*t+e[3]*r+e[5],n}function i(e,n){const t=(r=n)[0]*r[3]-r[1]*r[2];var r;!function(e,n){if(!e)throw new x(n)}(0!==t,32);const o=n[0],i=n[1],u=n[2],f=n[3],s=n[4],a=n[5];return e[0]=f/t,e[1]=-i/t,e[2]=-u/t,e[3]=o/t,e[4]=(u*a-f*s)/t,e[5]=-(o*a-i*s)/t,e}new Array(6);var u={exports:{}};function f(e,n,t){t=t||2;var r,x,o,i,u,f,v,c=n&&n.length,h=c?n[0]*t:e.length,y=s(e,0,h,t,!0),g=[];if(!y||y.next===y.prev)return g;if(c&&(y=function(e,n,t,r){var x,o,i,u=[];for(x=0,o=n.length;x<o;x++)(i=s(e,n[x]*r,x<o-1?n[x+1]*r:e.length,r,!1))===i.next&&(i.steiner=!0),u.push(w(i));for(u.sort(p),x=0;x<u.length;x++)t=a(t=d(u[x],t),t.next);return t}(e,n,y,t)),e.length>80*t){r=o=e[0],x=i=e[1];for(var b=t;b<h;b+=t)(u=e[b])<r&&(r=u),(f=e[b+1])<x&&(x=f),u>o&&(o=u),f>i&&(i=f);v=0!==(v=Math.max(o-r,i-x))?1/v:0}return l(y,g,t,r,x,v),g}function s(e,n,t,r,x){var o,i;if(x===B(e,n,t,r)>0)for(o=n;o<t;o+=r)i=_(o,e[o],e[o+1],i);else for(o=t-r;o>=n;o-=r)i=_(o,e[o],e[o+1],i);return i&&M(i,i.next)&&(k(i),i=i.next),i}function a(e,n){if(!e)return e;n||(n=e);var t,r=e;do{if(t=!1,r.steiner||!M(r,r.next)&&0!==A(r.prev,r,r.next))r=r.next;else{if(k(r),(r=n=r.prev)===r.next)break;t=!0}}while(t||r!==n);return n}function l(e,n,t,r,x,o,i){if(e){!i&&o&&function(e,n,t,r){var x=e;do{null===x.z&&(x.z=b(x.x,x.y,n,t,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==e);x.prevZ.nextZ=null,x.prevZ=null,function(e){var n,t,r,x,o,i,u,f,s=1;do{for(t=e,e=null,o=null,i=0;t;){for(i++,r=t,u=0,n=0;n<s&&(u++,r=r.nextZ);n++);for(f=s;u>0||f>0&&r;)0!==u&&(0===f||!r||t.z<=r.z)?(x=t,t=t.nextZ,u--):(x=r,r=r.nextZ,f--),o?o.nextZ=x:e=x,x.prevZ=o,o=x;t=r}o.nextZ=null,s*=2}while(i>1)}(x)}(e,r,x,o);for(var u,f,s=e;e.prev!==e.next;)if(u=e.prev,f=e.next,o?c(e,r,x,o):v(e))n.push(u.i/t),n.push(e.i/t),n.push(f.i/t),k(e),e=f.next,s=f.next;else if((e=f)===s){i?1===i?l(e=h(a(e),n,t),n,t,r,x,o,2):2===i&&y(e,n,t,r,x,o):l(a(e),n,t,r,x,o,1);break}}}function v(e){var n=e.prev,t=e,r=e.next;if(A(n,t,r)>=0)return!1;for(var x=e.next.next;x!==e.prev;){if(Z(n.x,n.y,t.x,t.y,r.x,r.y,x.x,x.y)&&A(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function c(e,n,t,r){var x=e.prev,o=e,i=e.next;if(A(x,o,i)>=0)return!1;for(var u=x.x<o.x?x.x<i.x?x.x:i.x:o.x<i.x?o.x:i.x,f=x.y<o.y?x.y<i.y?x.y:i.y:o.y<i.y?o.y:i.y,s=x.x>o.x?x.x>i.x?x.x:i.x:o.x>i.x?o.x:i.x,a=x.y>o.y?x.y>i.y?x.y:i.y:o.y>i.y?o.y:i.y,l=b(u,f,n,t,r),v=b(s,a,n,t,r),c=e.prevZ,h=e.nextZ;c&&c.z>=l&&h&&h.z<=v;){if(c!==e.prev&&c!==e.next&&Z(x.x,x.y,o.x,o.y,i.x,i.y,c.x,c.y)&&A(c.prev,c,c.next)>=0)return!1;if(c=c.prevZ,h!==e.prev&&h!==e.next&&Z(x.x,x.y,o.x,o.y,i.x,i.y,h.x,h.y)&&A(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;c&&c.z>=l;){if(c!==e.prev&&c!==e.next&&Z(x.x,x.y,o.x,o.y,i.x,i.y,c.x,c.y)&&A(c.prev,c,c.next)>=0)return!1;c=c.prevZ}for(;h&&h.z<=v;){if(h!==e.prev&&h!==e.next&&Z(x.x,x.y,o.x,o.y,i.x,i.y,h.x,h.y)&&A(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function h(e,n,t){var r=e;do{var x=r.prev,o=r.next.next;!M(x,o)&&E(x,r,r.next,o)&&I(x,o)&&I(o,x)&&(n.push(x.i/t),n.push(r.i/t),n.push(o.i/t),k(r),k(r.next),r=e=o),r=r.next}while(r!==e);return a(r)}function y(e,n,t,r,x,o){var i=e;do{for(var u=i.next.next;u!==i.prev;){if(i.i!==u.i&&m(i,u)){var f=P(i,u);return i=a(i,i.next),f=a(f,f.next),l(i,n,t,r,x,o),void l(f,n,t,r,x,o)}u=u.next}i=i.next}while(i!==e)}function p(e,n){return e.x-n.x}function d(e,n){var t=function(e,n){var t,r=n,x=e.x,o=e.y,i=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var u=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=x&&u>i){if(i=u,u===x){if(o===r.y)return r;if(o===r.next.y)return r.next}t=r.x<r.next.x?r:r.next}}r=r.next}while(r!==n);if(!t)return null;if(x===i)return t;var f,s=t,a=t.x,l=t.y,v=1/0;r=t;do{x>=r.x&&r.x>=a&&x!==r.x&&Z(o<l?x:i,o,a,l,o<l?i:x,o,r.x,r.y)&&(f=Math.abs(o-r.y)/(x-r.x),I(r,e)&&(f<v||f===v&&(r.x>t.x||r.x===t.x&&g(t,r)))&&(t=r,v=f)),r=r.next}while(r!==s);return t}(e,n);if(!t)return n;var r=P(t,e),x=a(t,t.next);return a(r,r.next),n===t?x:n}function g(e,n){return A(e.prev,e,n.prev)<0&&A(n.next,e,e.next)<0}function b(e,n,t,r,x){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-t)*x)|e<<8))|e<<4))|e<<2))|e<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-r)*x)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function w(e){var n=e,t=e;do{(n.x<t.x||n.x===t.x&&n.y<t.y)&&(t=n),n=n.next}while(n!==e);return t}function Z(e,n,t,r,x,o,i,u){return(x-i)*(n-u)-(e-i)*(o-u)>=0&&(e-i)*(r-u)-(t-i)*(n-u)>=0&&(t-i)*(o-u)-(x-i)*(r-u)>=0}function m(e,n){return e.next.i!==n.i&&e.prev.i!==n.i&&!function(e,n){var t=e;do{if(t.i!==e.i&&t.next.i!==e.i&&t.i!==n.i&&t.next.i!==n.i&&E(t,t.next,e,n))return!0;t=t.next}while(t!==e);return!1}(e,n)&&(I(e,n)&&I(n,e)&&function(e,n){var t=e,r=!1,x=(e.x+n.x)/2,o=(e.y+n.y)/2;do{t.y>o!=t.next.y>o&&t.next.y!==t.y&&x<(t.next.x-t.x)*(o-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next}while(t!==e);return r}(e,n)&&(A(e.prev,e,n.prev)||A(e,n.prev,n))||M(e,n)&&A(e.prev,e,e.next)>0&&A(n.prev,n,n.next)>0)}function A(e,n,t){return(n.y-e.y)*(t.x-n.x)-(n.x-e.x)*(t.y-n.y)}function M(e,n){return e.x===n.x&&e.y===n.y}function E(e,n,t,r){var x=F(A(e,n,t)),o=F(A(e,n,r)),i=F(A(t,r,e)),u=F(A(t,r,n));return x!==o&&i!==u||(!(0!==x||!O(e,t,n))||(!(0!==o||!O(e,r,n))||(!(0!==i||!O(t,e,r))||!(0!==u||!O(t,n,r)))))}function O(e,n,t){return n.x<=Math.max(e.x,t.x)&&n.x>=Math.min(e.x,t.x)&&n.y<=Math.max(e.y,t.y)&&n.y>=Math.min(e.y,t.y)}function F(e){return e>0?1:e<0?-1:0}function I(e,n){return A(e.prev,e,e.next)<0?A(e,n,e.next)>=0&&A(e,e.prev,n)>=0:A(e,n,e.prev)<0||A(e,e.next,n)<0}function P(e,n){var t=new z(e.i,e.x,e.y),r=new z(n.i,n.x,n.y),x=e.next,o=n.prev;return e.next=n,n.prev=e,t.next=x,x.prev=t,r.next=t,t.prev=r,o.next=r,r.prev=o,r}function _(e,n,t,r){var x=new z(e,n,t);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function k(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 z(e,n,t){this.i=e,this.x=n,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function B(e,n,t,r){for(var x=0,o=n,i=t-r;o<t;o+=r)x+=(e[i]-e[o])*(e[o+1]+e[i+1]),i=o;return x}u.exports=f,u.exports.default=f,f.deviation=function(e,n,t,r){var x=n&&n.length,o=x?n[0]*t:e.length,i=Math.abs(B(e,0,o,t));if(x)for(var u=0,f=n.length;u<f;u++){var s=n[u]*t,a=u<f-1?n[u+1]*t:e.length;i-=Math.abs(B(e,s,a,t))}var l=0;for(u=0;u<r.length;u+=3){var v=r[u]*t,c=r[u+1]*t,h=r[u+2]*t;l+=Math.abs((e[v]-e[h])*(e[c+1]-e[v+1])-(e[v]-e[c])*(e[h+1]-e[v+1]))}return 0===i&&0===l?0:Math.abs((l-i)/i)},f.flatten=function(e){for(var n=e[0][0].length,t={vertices:[],holes:[],dimensions:n},r=0,x=0;x<e.length;x++){for(var o=0;o<e[x].length;o++)for(var i=0;i<n;i++)t.vertices.push(e[x][o][i]);x>0&&(r+=e[x-1].length,t.holes.push(r))}return t};const G=[],N={vertexPosition:0,indexPosition:0};function R(e,n,t,r,x){e[n+0]=t,e[n+1]=r,e[n+2]=x}function S(e,n,t,r,x,o){const i=3+x,u=e[n+0],f=e[n+1],s=G;s.length=x;for(let t=0;t<s.length;t++)s[t]=e[n+2+t];let a=o?o.vertexPosition:0,l=o?o.indexPosition:0;const v=a/i;return R(t,a,u,f,0),s.length&&t.set(s,a+3),a+=i,R(t,a,u,f,1),s.length&&t.set(s,a+3),a+=i,R(t,a,u,f,2),s.length&&t.set(s,a+3),a+=i,R(t,a,u,f,3),s.length&&t.set(s,a+3),a+=i,r[l++]=v,r[l++]=v+1,r[l++]=v+3,r[l++]=v+1,r[l++]=v+2,r[l++]=v+3,N.vertexPosition=a,N.indexPosition=l,N}function T(e,n,t,r,x,i,u,f,s,a){const l=5+f.length,v=i.length/l,c=[e[n+0],e[n+1]],h=[e[t],e[t+1]],y=o(a,[...c]),p=o(a,[...h]);function d(e,n,t){const r=1e4;return Math.round(1500*n)+Math.round(1500*t)*r+e*r*r}function g(e,n,t){const r=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),x=[(n[0]-e[0])/r,(n[1]-e[1])/r],o=[-x[1],x[0]],i=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),u=[(t[0]-e[0])/i,(t[1]-e[1])/i],f=0===r||0===i?0:Math.acos((s=u[0]*x[0]+u[1]*x[1],a=-1,l=1,Math.min(Math.max(s,a),l)));var s,a,l;return u[0]*o[0]+u[1]*o[1]>0?f:2*Math.PI-f}const b=null!==x;let w=0,Z=0;if(null!==r){w=g(y,p,o(a,[...[e[r],e[r+1]]]))}if(b){Z=g(p,y,o(a,[...[e[x],e[x+1]]]))}i.push(c[0],c[1],h[0],h[1],d(0,w,Z)),i.push(...f),i.push(c[0],c[1],h[0],h[1],d(1,w,Z)),i.push(...f),i.push(c[0],c[1],h[0],h[1],d(2,w,Z)),i.push(...f),i.push(c[0],c[1],h[0],h[1],d(3,w,Z)),i.push(...f),u.push(v,v+1,v+2,v+1,v+3,v+2)}function U(e,n,t,r,x){const o=2+x;let i=n;const f=e.slice(i,i+x);i+=x;const s=e[i++];let a=0;const l=new Array(s-1);for(let n=0;n<s;n++)a+=e[i++],n<s-1&&(l[n]=a);const v=e.slice(i,i+2*a),c=u.exports(v,l,2);for(let e=0;e<c.length;e++)r.push(c[e]+t.length/o);for(let e=0;e<v.length;e+=2)t.push(v[e],v[e+1],...f);return i+2*a}const C=self;C.onmessage=r=>{const x=r.data;switch(x.type){case n:{const e=3,n=2,t=x.customAttributesCount,r=n+t,o=new Float32Array(x.renderInstructions),i=o.length/r,u=4*i*(t+e),f=new Uint32Array(6*i),s=new Float32Array(u);let a;for(let e=0;e<o.length;e+=r)a=S(o,e,s,f,t,a);const l=Object.assign({vertexBuffer:s.buffer,indexBuffer:f.buffer,renderInstructions:o.buffer},x);C.postMessage(l,[s.buffer,f.buffer,o.buffer]);break}case t:{const e=[],n=[],t=x.customAttributesCount,r=2,o=new Float32Array(x.renderInstructions);let u=0;const f=x.renderInstructionsTransform,s=[1,0,0,1,0,0];let a,l;for(i(s,f);u<o.length;){l=Array.from(o.slice(u,u+t)),u+=t,a=o[u++];for(let t=0;t<a-1;t++)T(o,u+t*r,u+(t+1)*r,t>0?u+(t-1)*r:null,t<a-2?u+(t+2)*r:null,e,n,l,0,s);u+=a*r}const v=Uint32Array.from(n),c=Float32Array.from(e),h=Object.assign({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:o.buffer},x);C.postMessage(h,[c.buffer,v.buffer,o.buffer]);break}case e:{const e=[],n=[],t=x.customAttributesCount,r=new Float32Array(x.renderInstructions);let o=0;for(;o<r.length;)o=U(r,o,e,n,t);const i=Uint32Array.from(n),u=Float32Array.from(e),f=Object.assign({vertexBuffer:u.buffer,indexBuffer:i.buffer,renderInstructions:r.buffer},x);C.postMessage(f,[u.buffer,i.buffer,r.buffer]);break}}};";
|
|
3
3
|
return new Worker(typeof Blob === 'undefined'
|
|
4
4
|
? 'data:application/javascript;base64,' + Buffer.from(source, 'binary').toString('base64')
|
|
5
5
|
: URL.createObjectURL(new Blob([source], { type: 'application/javascript' })));
|
package/worker/webgl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl.js","sourceRoot":"","sources":["../src/worker/webgl.js"],"names":[],"mappings":"AACQ,MAAM,UAAU,MAAM;IACpB,IAAM,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"webgl.js","sourceRoot":"","sources":["../src/worker/webgl.js"],"names":[],"mappings":"AACQ,MAAM,UAAU,MAAM;IACpB,IAAM,MAAM,GAAG,ujVAAujV,CAAC;IACvkV,OAAO,IAAI,MAAM,CAAC,OAAO,IAAI,KAAK,WAAW;QAC3C,CAAC,CAAC,qCAAqC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC1F,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,EAAC,IAAI,EAAE,wBAAwB,EAAC,CAAC,CAAC,CAAC,CAAC;AACjF,CAAC"}
|