@vcmap/core 5.0.0-rc.10 → 5.0.0-rc.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +201 -125
- package/index.js +2 -3
- package/package.json +6 -2
- package/src/category/category.js +21 -5
- package/src/classRegistry.js +0 -6
- package/src/context.js +0 -1
- package/src/featureProvider/abstractFeatureProvider.js +0 -1
- package/src/featureProvider/wmsFeatureProvider.js +0 -1
- package/src/interaction/abstractInteraction.js +0 -1
- package/src/interaction/interactionChain.js +0 -1
- package/src/interaction/interactionType.js +1 -5
- package/src/layer/cesium/cesiumTilesetCesiumImpl.js +2 -3
- package/src/layer/cesium/dataSourceCesiumImpl.js +0 -1
- package/src/layer/cesium/openStreetMapCesiumImpl.js +0 -1
- package/src/layer/cesium/rasterLayerCesiumImpl.js +0 -1
- package/src/layer/cesium/singleImageCesiumImpl.js +0 -1
- package/src/layer/cesium/terrainCesiumImpl.js +0 -1
- package/src/layer/cesium/tmsCesiumImpl.js +0 -1
- package/src/layer/cesium/vectorCesiumImpl.js +3 -4
- package/src/layer/cesium/vectorRasterTileCesiumImpl.js +0 -1
- package/src/layer/cesium/vectorTileImageryProvider.js +0 -1
- package/src/layer/cesium/wmsCesiumImpl.js +0 -1
- package/src/layer/cesium/wmtsCesiumImpl.js +0 -1
- package/src/layer/cesiumTilesetLayer.js +0 -1
- package/src/layer/czmlLayer.js +0 -1
- package/src/layer/dataSourceLayer.js +25 -16
- package/src/layer/featureLayer.js +10 -1
- package/src/layer/featureStoreLayer.js +1 -1
- package/src/layer/featureStoreLayerState.js +0 -1
- package/src/layer/featureVisibility.js +3 -1
- package/src/layer/geojsonHelpers.js +0 -4
- package/src/layer/geojsonLayer.js +0 -1
- package/src/layer/globalHider.js +7 -21
- package/src/layer/layer.js +84 -38
- package/src/layer/layerImplementation.js +0 -1
- package/src/layer/layerState.js +0 -1
- package/src/layer/oblique/vectorObliqueImpl.js +1 -3
- package/src/layer/openStreetMapLayer.js +0 -1
- package/src/layer/openlayers/layerOpenlayersImpl.js +0 -1
- package/src/layer/openlayers/openStreetMapOpenlayersImpl.js +0 -1
- package/src/layer/openlayers/singleImageOpenlayersImpl.js +0 -1
- package/src/layer/openlayers/tileDebugOpenlayersImpl.js +0 -1
- package/src/layer/openlayers/tmsOpenlayersImpl.js +0 -1
- package/src/layer/openlayers/vectorOpenlayersImpl.js +2 -3
- package/src/layer/openlayers/vectorTileOpenlayersImpl.js +0 -1
- package/src/layer/openlayers/wmsOpenlayersImpl.js +0 -1
- package/src/layer/openlayers/wmtsOpenlayersImpl.js +0 -1
- package/src/layer/pointCloudLayer.js +0 -1
- package/src/layer/rasterLayer.js +0 -2
- package/src/layer/singleImageLayer.js +0 -1
- package/src/layer/terrainLayer.js +0 -1
- package/src/layer/tileProvider/mvtTileProvider.js +21 -2
- package/src/layer/tileProvider/staticGeojsonTileProvider.js +0 -1
- package/src/layer/tileProvider/tileProvider.js +27 -1
- package/src/layer/tileProvider/urlTemplateTileProvider.js +26 -6
- package/src/layer/tmsLayer.js +0 -1
- package/src/layer/vectorLayer.js +0 -1
- package/src/layer/vectorProperties.js +0 -1
- package/src/layer/vectorTileLayer.js +45 -13
- package/src/layer/wfsLayer.js +0 -1
- package/src/layer/wmsLayer.js +0 -1
- package/src/layer/wmtsLayer.js +0 -1
- package/src/map/baseOLMap.js +0 -1
- package/src/map/cameraLimiter.js +0 -1
- package/src/map/cesiumMap.js +0 -1
- package/src/map/mapState.js +0 -1
- package/src/map/obliqueMap.js +0 -1
- package/src/map/openlayersMap.js +0 -1
- package/src/map/vcsMap.js +6 -2
- package/src/oblique/helpers.js +0 -3
- package/src/oblique/obliqueCollection.js +0 -1
- package/src/oblique/obliqueDataSet.js +0 -2
- package/src/oblique/obliqueImage.js +0 -1
- package/src/oblique/obliqueImageMeta.js +0 -1
- package/src/oblique/obliqueProvider.js +0 -1
- package/src/oblique/obliqueView.js +0 -1
- package/src/oblique/obliqueViewDirection.js +0 -3
- package/src/ol/render/canvas/canvasTileRenderer.js +0 -1
- package/src/style/declarativeStyleItem.js +0 -1
- package/src/style/shapesCategory.js +0 -2
- package/src/style/styleHelpers.js +0 -11
- package/src/style/styleItem.js +0 -1
- package/src/style/vectorStyleItem.js +0 -4
- package/src/util/clipping/clippingObject.js +0 -2
- package/src/util/clipping/clippingObjectManager.js +0 -1
- package/src/util/clipping/clippingPlaneHelper.js +0 -4
- package/src/util/collection.js +15 -3
- package/src/util/extent.js +0 -1
- package/src/util/indexedCollection.js +0 -1
- package/src/util/layerCollection.js +71 -6
- package/src/util/locale.js +1 -42
- package/src/util/mapCollection.js +29 -14
- package/src/util/overrideCollection.js +8 -9
- package/src/util/projection.js +0 -5
- package/src/util/viewpoint.js +0 -4
- package/src/vcsApp.js +53 -0
- package/src/vcsEvent.js +0 -1
- package/tests/data/buildings/tileset.json +428 -0
- package/tests/data/dynamicPointCzml.json +64 -0
- package/tests/data/oblique/imageData/imagev34.json +352 -0
- package/tests/data/oblique/imageData/imagev35.json +54 -0
- package/tests/data/oblique/imageData/imagev35PerImageSize.json +53 -0
- package/tests/data/oblique/tiledImageData/12/2199/1342.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2199/1343.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2199/1344.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2200/1342.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2200/1343.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2200/1344.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2201/1342.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2201/1343.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2201/1344.json +1 -0
- package/tests/data/oblique/tiledImageData/image.json +1 -0
- package/tests/data/terrain/13/8800/6485.terrain +0 -0
- package/tests/data/terrain/13/8800/6486.terrain +0 -0
- package/tests/data/terrain/13/8801/6485.terrain +0 -0
- package/tests/data/terrain/13/8801/6486.terrain +0 -0
- package/tests/data/terrain/layer.json +136 -0
- package/tests/data/testGeoJSON.json +161 -0
- package/tests/data/tile.pbf +0 -0
- package/tests/unit/helpers/cesiumHelpers.js +272 -0
- package/tests/unit/helpers/getFileNameFromUrl.js +12 -0
- package/tests/unit/helpers/helpers.js +11 -0
- package/tests/unit/helpers/imageHelpers.js +20 -0
- package/tests/unit/helpers/importJSON.js +15 -0
- package/tests/unit/helpers/obliqueData.js +76 -0
- package/tests/unit/helpers/obliqueHelpers.js +112 -0
- package/tests/unit/helpers/openlayersHelpers.js +22 -0
- package/tests/unit/helpers/terrain/terrainData.js +46 -0
- package/src/util/dateTime.js +0 -60
|
@@ -69,7 +69,6 @@ function synchronizeFeatureVisibility(featureVisibility, globalHider, feature) {
|
|
|
69
69
|
/**
|
|
70
70
|
* VectorTileLayer Layer for tiled vector Data. Can be connected to data with a TileProvider
|
|
71
71
|
* @class
|
|
72
|
-
* @export
|
|
73
72
|
* @extends {FeatureLayer}
|
|
74
73
|
* @api stable
|
|
75
74
|
*/
|
|
@@ -139,6 +138,9 @@ class VectorTileLayer extends FeatureLayer {
|
|
|
139
138
|
this.tileProvider = options.tileProvider instanceof TileProvider ? // XXX this now throws if not passing in a tileProvider.
|
|
140
139
|
options.tileProvider :
|
|
141
140
|
getObjectFromClassRegistry(tileProviderClassRegistry, options.tileProvider);
|
|
141
|
+
if (this.tileProvider) {
|
|
142
|
+
this.tileProvider.locale = this.locale;
|
|
143
|
+
}
|
|
142
144
|
|
|
143
145
|
/**
|
|
144
146
|
* @type {number|undefined}
|
|
@@ -156,7 +158,7 @@ class VectorTileLayer extends FeatureLayer {
|
|
|
156
158
|
* @type {Array<Function>}
|
|
157
159
|
* @private
|
|
158
160
|
*/
|
|
159
|
-
this.
|
|
161
|
+
this._featureVisibilityListeners = [];
|
|
160
162
|
|
|
161
163
|
/**
|
|
162
164
|
* @type {Function}
|
|
@@ -178,6 +180,25 @@ class VectorTileLayer extends FeatureLayer {
|
|
|
178
180
|
this._styleZIndex = 0;
|
|
179
181
|
}
|
|
180
182
|
|
|
183
|
+
/**
|
|
184
|
+
* returns the currently set locale. Can be used to provide locale specific URLs.
|
|
185
|
+
* @type {string}
|
|
186
|
+
*/
|
|
187
|
+
get locale() {
|
|
188
|
+
return super.locale;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* sets the locale and reloads the layer the if the URL is a locale aware Object.
|
|
193
|
+
* @param {string} value
|
|
194
|
+
*/
|
|
195
|
+
set locale(value) {
|
|
196
|
+
if (this.tileProvider) {
|
|
197
|
+
this.tileProvider.locale = super.locale;
|
|
198
|
+
}
|
|
199
|
+
super.locale = value;
|
|
200
|
+
}
|
|
201
|
+
|
|
181
202
|
/**
|
|
182
203
|
* initializes the layer, can be used to defer loading
|
|
183
204
|
* @returns {Promise<void>}
|
|
@@ -255,15 +276,24 @@ class VectorTileLayer extends FeatureLayer {
|
|
|
255
276
|
}
|
|
256
277
|
|
|
257
278
|
/**
|
|
258
|
-
*
|
|
259
|
-
|
|
279
|
+
* @param {import("@vcmap/core").GlobalHider} globalHider
|
|
280
|
+
*/
|
|
281
|
+
setGlobalHider(globalHider) {
|
|
282
|
+
super.setGlobalHider(globalHider);
|
|
283
|
+
this._setupFeatureVisibilityHandlers();
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Sets up listeners for featureVisibility and global hider
|
|
260
288
|
* @private
|
|
261
289
|
*/
|
|
262
290
|
_setupFeatureVisibilityHandlers() {
|
|
263
291
|
if (!this.tileProvider.trackFeaturesToTiles) {
|
|
264
|
-
return
|
|
292
|
+
return;
|
|
265
293
|
}
|
|
266
|
-
|
|
294
|
+
this._featureVisibilityListeners.forEach((cb) => { cb(); });
|
|
295
|
+
|
|
296
|
+
this._featureVisibilityListeners = [
|
|
267
297
|
this.featureVisibility.changed.addEventListener(({ action, ids }) => {
|
|
268
298
|
const tileIdsChanged = new Set();
|
|
269
299
|
ids.forEach((id) => {
|
|
@@ -290,8 +320,10 @@ class VectorTileLayer extends FeatureLayer {
|
|
|
290
320
|
});
|
|
291
321
|
this.updateTiles([...tileIdsChanged]);
|
|
292
322
|
}),
|
|
323
|
+
];
|
|
293
324
|
|
|
294
|
-
|
|
325
|
+
if (this.globalHider) {
|
|
326
|
+
this._featureVisibilityListeners.push(this.globalHider.changed.addEventListener(({ action, ids }) => {
|
|
295
327
|
const tileIdsChanged = new Set();
|
|
296
328
|
ids.forEach((id) => {
|
|
297
329
|
const tileIds = this.tileProvider.featureIdToTileIds.get(id);
|
|
@@ -312,8 +344,8 @@ class VectorTileLayer extends FeatureLayer {
|
|
|
312
344
|
}
|
|
313
345
|
});
|
|
314
346
|
this.updateTiles([...tileIdsChanged]);
|
|
315
|
-
})
|
|
316
|
-
|
|
347
|
+
}));
|
|
348
|
+
}
|
|
317
349
|
}
|
|
318
350
|
|
|
319
351
|
/**
|
|
@@ -401,8 +433,8 @@ class VectorTileLayer extends FeatureLayer {
|
|
|
401
433
|
*/
|
|
402
434
|
async activate() {
|
|
403
435
|
await super.activate();
|
|
404
|
-
this.
|
|
405
|
-
if (this.tileProvider.trackFeaturesToTiles) {
|
|
436
|
+
this._setupFeatureVisibilityHandlers();
|
|
437
|
+
if (this.tileProvider.trackFeaturesToTiles && this.globalHider) {
|
|
406
438
|
this.tileProvider.forEachFeature((feature) => {
|
|
407
439
|
synchronizeFeatureVisibility(this.featureVisibility, this.globalHider, feature);
|
|
408
440
|
});
|
|
@@ -415,7 +447,7 @@ class VectorTileLayer extends FeatureLayer {
|
|
|
415
447
|
*/
|
|
416
448
|
deactivate() {
|
|
417
449
|
super.deactivate();
|
|
418
|
-
this.
|
|
450
|
+
this._featureVisibilityListeners.forEach((cb) => { cb(); });
|
|
419
451
|
}
|
|
420
452
|
|
|
421
453
|
/**
|
|
@@ -423,7 +455,7 @@ class VectorTileLayer extends FeatureLayer {
|
|
|
423
455
|
* @api
|
|
424
456
|
*/
|
|
425
457
|
destroy() {
|
|
426
|
-
this.
|
|
458
|
+
this._featureVisibilityListeners.forEach((cb) => { cb(); });
|
|
427
459
|
super.destroy();
|
|
428
460
|
this._tileLoadEventListener();
|
|
429
461
|
if (this.featureProvider) {
|
package/src/layer/wfsLayer.js
CHANGED
package/src/layer/wmsLayer.js
CHANGED
package/src/layer/wmtsLayer.js
CHANGED
package/src/map/baseOLMap.js
CHANGED
package/src/map/cameraLimiter.js
CHANGED
package/src/map/cesiumMap.js
CHANGED
package/src/map/mapState.js
CHANGED
package/src/map/obliqueMap.js
CHANGED
package/src/map/openlayersMap.js
CHANGED
package/src/map/vcsMap.js
CHANGED
|
@@ -504,13 +504,17 @@ class VcsMap extends VcsObject {
|
|
|
504
504
|
this._collectionListeners.forEach((cb) => { cb(); });
|
|
505
505
|
this._collectionListeners = [];
|
|
506
506
|
|
|
507
|
-
|
|
507
|
+
if (this.layerCollection) {
|
|
508
|
+
[...this.layerCollection].forEach((l) => {
|
|
509
|
+
l.removedFromMap(this);
|
|
510
|
+
});
|
|
511
|
+
}
|
|
508
512
|
if (this.stateChanged) {
|
|
509
513
|
this.stateChanged.destroy();
|
|
510
514
|
this.stateChanged = null;
|
|
511
515
|
}
|
|
512
516
|
|
|
513
|
-
if (this.destroyLayerCollection) {
|
|
517
|
+
if (this.destroyLayerCollection && this.layerCollection) {
|
|
514
518
|
this.layerCollection.destroy();
|
|
515
519
|
}
|
|
516
520
|
|
package/src/oblique/helpers.js
CHANGED
|
@@ -80,7 +80,6 @@ function angleBetweenTwo2DVectors(v1, v2) {
|
|
|
80
80
|
* @param {Array<import("ol/coordinate").Coordinate>} segment1
|
|
81
81
|
* @param {Array<import("ol/coordinate").Coordinate>} segment2
|
|
82
82
|
* @returns {{x: (number|null), y:(number|null), onLine1: boolean, onLine2: boolean}}
|
|
83
|
-
* @export
|
|
84
83
|
*/
|
|
85
84
|
export function checkLineIntersection(segment1, segment2) {
|
|
86
85
|
// if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point
|
|
@@ -306,7 +305,6 @@ export function transformCWIFC(inputOrigin, inputTarget, originIsImage, coordina
|
|
|
306
305
|
* @param {import("ol/coordinate").Coordinate} worldCoordinate if not in web mercatpr, specify data-projection in options
|
|
307
306
|
* @param {ImageTransformationOptions=} options
|
|
308
307
|
* @returns {Promise<{coords: import("ol/coordinate").Coordinate, height: number, estimate: (boolean|undefined)}>}
|
|
309
|
-
* @export
|
|
310
308
|
*/
|
|
311
309
|
export function transformToImage(image, worldCoordinate, options = {}) {
|
|
312
310
|
let gpInternalCoordinates;
|
|
@@ -404,7 +402,6 @@ function pickTerrain(pickTerrainOptions) {
|
|
|
404
402
|
* @param {import("ol/coordinate").Coordinate} imageCoordinate
|
|
405
403
|
* @param {ImageTransformationOptions=} options
|
|
406
404
|
* @returns {Promise<PickTerrainReturn>} return coordinates are in mercator if not specified in options
|
|
407
|
-
* @export
|
|
408
405
|
*/
|
|
409
406
|
export async function transformFromImage(image, imageCoordinate, options = {}) {
|
|
410
407
|
const initialWorldCoords = transform(
|
|
@@ -18,7 +18,6 @@ import { requestJson } from '../util/fetch.js';
|
|
|
18
18
|
* @property {number} PENDING
|
|
19
19
|
* @property {number} LOADING
|
|
20
20
|
* @property {number} READY
|
|
21
|
-
* @export
|
|
22
21
|
* @api
|
|
23
22
|
*/
|
|
24
23
|
export const DataState = {
|
|
@@ -45,7 +44,6 @@ export function getStateFromStatesArray(states) {
|
|
|
45
44
|
|
|
46
45
|
/**
|
|
47
46
|
* @class
|
|
48
|
-
* @export
|
|
49
47
|
*/
|
|
50
48
|
class ObliqueDataSet {
|
|
51
49
|
/**
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* @property {number} SOUTH
|
|
7
7
|
* @property {number} WEST
|
|
8
8
|
* @property {number} NADIR
|
|
9
|
-
* @export
|
|
10
9
|
* @api
|
|
11
10
|
*/
|
|
12
11
|
export const ObliqueViewDirection = {
|
|
@@ -19,7 +18,6 @@ export const ObliqueViewDirection = {
|
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* @type {Object<string, ObliqueViewDirection>}
|
|
22
|
-
* @export
|
|
23
21
|
*/
|
|
24
22
|
export const obliqueViewDirectionNames = {
|
|
25
23
|
north: ObliqueViewDirection.NORTH,
|
|
@@ -32,7 +30,6 @@ export const obliqueViewDirectionNames = {
|
|
|
32
30
|
/**
|
|
33
31
|
* @param {number} direction
|
|
34
32
|
* @returns {string|undefined}
|
|
35
|
-
* @export
|
|
36
33
|
*/
|
|
37
34
|
export function getDirectionName(direction) {
|
|
38
35
|
return Object.keys(obliqueViewDirectionNames)
|
|
@@ -8,7 +8,6 @@ import { transform2D } from 'ol/geom/flat/transform.js';
|
|
|
8
8
|
* @class
|
|
9
9
|
* @extends {CanvasImmediateRenderer}
|
|
10
10
|
* @memberOf ol
|
|
11
|
-
* @exports
|
|
12
11
|
* Tile Renderer Implementation of openlayers CanvasImmediateRenderer
|
|
13
12
|
* can be used to allow for a correction Factor to take into account Mercator Tile distortion
|
|
14
13
|
*/
|
|
@@ -6,7 +6,6 @@ import Circle from 'ol/style/Circle.js';
|
|
|
6
6
|
/**
|
|
7
7
|
* @param {VectorStyleItemImage} options
|
|
8
8
|
* @returns {import("ol/style/RegularShape").default|import("ol/style/Circle").default}
|
|
9
|
-
* @export
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
export function getShapeFromOptions(options) {
|
|
@@ -43,7 +42,6 @@ class ShapeCategory {
|
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
/**
|
|
46
|
-
* @export
|
|
47
45
|
* TODO refactor to getdefaultShapeCategory...
|
|
48
46
|
*/
|
|
49
47
|
export const shapeCategory = new ShapeCategory();
|
|
@@ -27,7 +27,6 @@ function getLogger() {
|
|
|
27
27
|
/**
|
|
28
28
|
* @enum {number}
|
|
29
29
|
* @const
|
|
30
|
-
* @export
|
|
31
30
|
* @property {number} NWSE
|
|
32
31
|
* @property {number} SWNE
|
|
33
32
|
* @property {number} DIAGONALCROSS
|
|
@@ -50,7 +49,6 @@ export const PatternType = {
|
|
|
50
49
|
* @param {string} h
|
|
51
50
|
* @param {number=} opacity
|
|
52
51
|
* @returns {import("ol/color").Color}
|
|
53
|
-
* @export
|
|
54
52
|
*/
|
|
55
53
|
export function hexToOlColor(h, opacity) {
|
|
56
54
|
let hex = h.substring(1);
|
|
@@ -81,7 +79,6 @@ export function cesiumColorToColor(cesiumColor) {
|
|
|
81
79
|
* @param {import("ol/color").Color} olColor
|
|
82
80
|
* @returns {import("@vcmap/cesium").Color}
|
|
83
81
|
* @api
|
|
84
|
-
* @export
|
|
85
82
|
*/
|
|
86
83
|
export function olColorToCesiumColor(olColor) {
|
|
87
84
|
return Color.fromBytes(olColor[0], olColor[1], olColor[2], olColor[3] * 255);
|
|
@@ -93,7 +90,6 @@ export function olColorToCesiumColor(olColor) {
|
|
|
93
90
|
* @param {import("ol/color").Color=} defaultColor
|
|
94
91
|
* @returns {import("ol/color").Color}
|
|
95
92
|
* @api
|
|
96
|
-
* @export
|
|
97
93
|
*/
|
|
98
94
|
export function parseColor(color, defaultColor) {
|
|
99
95
|
if (Array.isArray(color)) {
|
|
@@ -135,7 +131,6 @@ export function parseColor(color, defaultColor) {
|
|
|
135
131
|
* @param {import("ol/color").Color|import("ol/colorlike").ColorLike} color
|
|
136
132
|
* @param {import("ol/color").Color} defaultColor
|
|
137
133
|
* @returns {import("@vcmap/cesium").Color}
|
|
138
|
-
* @export
|
|
139
134
|
*/
|
|
140
135
|
export function getCesiumColor(color, defaultColor) {
|
|
141
136
|
const olColor = parseColor(color, defaultColor);
|
|
@@ -145,7 +140,6 @@ export function getCesiumColor(color, defaultColor) {
|
|
|
145
140
|
/**
|
|
146
141
|
* @param {import("ol/color").Color|Array<number>|import("ol/colorlike").ColorLike} color
|
|
147
142
|
* @returns {string}
|
|
148
|
-
* @export
|
|
149
143
|
*/
|
|
150
144
|
export function getStringColor(color) {
|
|
151
145
|
return `rgba(${parseColor(color).join(',')})`;
|
|
@@ -155,7 +149,6 @@ export function getStringColor(color) {
|
|
|
155
149
|
* @param {VectorStyleItemFill} options
|
|
156
150
|
* @param {HTMLCanvasElement=} optCanvas
|
|
157
151
|
* @returns {CanvasPattern}
|
|
158
|
-
* @export
|
|
159
152
|
*/
|
|
160
153
|
export function createPattern(options, optCanvas) {
|
|
161
154
|
const pixelRatio = DEVICE_PIXEL_RATIO;
|
|
@@ -215,7 +208,6 @@ export function createPattern(options, optCanvas) {
|
|
|
215
208
|
/**
|
|
216
209
|
* @param {import("ol/color").Color} color
|
|
217
210
|
* @returns {string}
|
|
218
|
-
* @export
|
|
219
211
|
*/
|
|
220
212
|
export function olColorToHex(color) {
|
|
221
213
|
function componentHex(c) {
|
|
@@ -230,7 +222,6 @@ export function olColorToHex(color) {
|
|
|
230
222
|
/**
|
|
231
223
|
* @param {string} colorValue
|
|
232
224
|
* @returns {boolean}
|
|
233
|
-
* @export
|
|
234
225
|
*/
|
|
235
226
|
export function validateHexColor(colorValue) {
|
|
236
227
|
return /^#[0-9a-f]{6}$/.test(colorValue);
|
|
@@ -239,7 +230,6 @@ export function validateHexColor(colorValue) {
|
|
|
239
230
|
/**
|
|
240
231
|
* @param {string|FontObject} font
|
|
241
232
|
* @returns {FontObject}
|
|
242
|
-
* @export
|
|
243
233
|
*/
|
|
244
234
|
export function parseFont(font) {
|
|
245
235
|
if (typeof font !== 'string') {
|
|
@@ -310,7 +300,6 @@ export function parseFont(font) {
|
|
|
310
300
|
/**
|
|
311
301
|
* @param {FontObject} fontObject
|
|
312
302
|
* @returns {string}
|
|
313
|
-
* @export
|
|
314
303
|
*/
|
|
315
304
|
export function combineFont(fontObject) {
|
|
316
305
|
const order = [
|
package/src/style/styleItem.js
CHANGED
|
@@ -118,14 +118,12 @@ export const OlcsGeometryType = {
|
|
|
118
118
|
* Is set by the Editor if the layerStyle is overwritten. The VectorLayer layer assures this style is set, if
|
|
119
119
|
* the style on the layer is not a DeclarativeStyle
|
|
120
120
|
* @type {symbol}
|
|
121
|
-
* @export
|
|
122
121
|
*/
|
|
123
122
|
export const vectorStyleSymbol = Symbol('VcsVectorStyleItem');
|
|
124
123
|
|
|
125
124
|
/**
|
|
126
125
|
* @class
|
|
127
126
|
* @extends {StyleItem}
|
|
128
|
-
* @export
|
|
129
127
|
* @api
|
|
130
128
|
*/
|
|
131
129
|
class VectorStyleItem extends StyleItem {
|
|
@@ -895,7 +893,6 @@ export default VectorStyleItem;
|
|
|
895
893
|
|
|
896
894
|
/**
|
|
897
895
|
* @type {VectorStyleItem}
|
|
898
|
-
* @export
|
|
899
896
|
*/
|
|
900
897
|
export const defaultVectorStyle = new VectorStyleItem(getDefaultVectorStyleItemOptions());
|
|
901
898
|
styleClassRegistry.registerClass(VectorStyleItem.className, VectorStyleItem);
|
|
@@ -903,7 +900,6 @@ styleClassRegistry.registerClass(VectorStyleItem.className, VectorStyleItem);
|
|
|
903
900
|
/**
|
|
904
901
|
* @param {import("@vcmap/cesium").Color} cesiumColor
|
|
905
902
|
* @returns {VectorStyleItem}
|
|
906
|
-
* @export
|
|
907
903
|
*/
|
|
908
904
|
export function fromCesiumColor(cesiumColor) {
|
|
909
905
|
const color = /** @type {import("ol/color").Color} */ (cesiumColor.toBytes());
|
|
@@ -10,7 +10,6 @@ import LayerCollection from '../layerCollection.js';
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @namespace clipping
|
|
13
|
-
* @export
|
|
14
13
|
* @api
|
|
15
14
|
*/
|
|
16
15
|
|
|
@@ -50,7 +49,6 @@ const globeSymbol = Symbol('ClippingObjectGlobe');
|
|
|
50
49
|
* To update the Cesium.ClippingPlaneCollection or its definitions, you must trigger an update by setting the clippingPlaneCollection
|
|
51
50
|
* property to the new definition.
|
|
52
51
|
* @class
|
|
53
|
-
* @export
|
|
54
52
|
* @api stable
|
|
55
53
|
*/
|
|
56
54
|
class ClippingObject {
|
|
@@ -12,7 +12,6 @@ import CesiumMap from '../../map/cesiumMap.js';
|
|
|
12
12
|
* overwritten in the order they where added to the manager. Exclusive [ClippingObjects]{@link ClippingObject} are always applied last, even
|
|
13
13
|
* if a default [ClippingObject]{@link ClippingObject} is added after.
|
|
14
14
|
* @class
|
|
15
|
-
* @export
|
|
16
15
|
* @api stable
|
|
17
16
|
*/
|
|
18
17
|
class ClippingObjectManager {
|
|
@@ -139,7 +139,6 @@ function createEndingPlanes(coords) {
|
|
|
139
139
|
* @param {import("@vcmap/cesium").Matrix4=} transformMatrix - 4x4 matrix specifying the transform of clipping planes from Earth's fixed frame to another one
|
|
140
140
|
* @returns {import("@vcmap/cesium").ClippingPlaneCollection|null}
|
|
141
141
|
* @api stable
|
|
142
|
-
* @export
|
|
143
142
|
*/
|
|
144
143
|
export function createClippingPlaneCollection(feature, options = {}, transformMatrix) {
|
|
145
144
|
check(feature, Feature);
|
|
@@ -203,7 +202,6 @@ export function createClippingPlaneCollection(feature, options = {}, transformMa
|
|
|
203
202
|
* @param {import("@vcmap/cesium").Cartesian3=} originPoint - the origin point of the transformation target, so the plane distance can be set correctly
|
|
204
203
|
* @returns {import("@vcmap/cesium").ClippingPlaneCollection}
|
|
205
204
|
* @api stable
|
|
206
|
-
* @export
|
|
207
205
|
*/
|
|
208
206
|
export function copyClippingPlanesToCollection(source, result, transformMatrix, originPoint) {
|
|
209
207
|
check(source, ClippingPlaneCollection);
|
|
@@ -346,7 +344,6 @@ export function setClippingPlanes(target, clippingPlaneCollection, local) {
|
|
|
346
344
|
* @param {number} [offsetDistance=25] - the offset from the coordinate to use for the size of the geometry
|
|
347
345
|
* @returns {import("ol").Feature<import("ol/geom/Geometry").default>} - the features geometry is in web mercator
|
|
348
346
|
* @api
|
|
349
|
-
* @export
|
|
350
347
|
*/
|
|
351
348
|
export function createClippingFeature(coordinate, camera, vertical = false, offsetDistance = 25) {
|
|
352
349
|
check(coordinate, [Number]);
|
|
@@ -389,7 +386,6 @@ export function createClippingFeature(coordinate, camera, vertical = false, offs
|
|
|
389
386
|
* @param {boolean=} [infinite=false]
|
|
390
387
|
* @returns {CreationOptions}
|
|
391
388
|
* @api
|
|
392
|
-
* @export
|
|
393
389
|
*/
|
|
394
390
|
export function getClippingOptions(feature, infinite = false) {
|
|
395
391
|
checkMaybe(feature, Feature);
|
package/src/util/collection.js
CHANGED
|
@@ -3,7 +3,6 @@ import VcsEvent from '../vcsEvent.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* A generic array based collection. Implements the Symbol.iterator (e.g. [...collection])
|
|
5
5
|
* @class
|
|
6
|
-
* @export
|
|
7
6
|
* @template {*} T
|
|
8
7
|
* @api
|
|
9
8
|
*/
|
|
@@ -135,15 +134,28 @@ class Collection {
|
|
|
135
134
|
return null;
|
|
136
135
|
}
|
|
137
136
|
|
|
137
|
+
/**
|
|
138
|
+
* internal remove function, to remove an item from the collection, does not raise an event.
|
|
139
|
+
* @param {T} item
|
|
140
|
+
* @returns {number} returns the index of the removed item or -1 if the item has not been found.
|
|
141
|
+
* @protected
|
|
142
|
+
*/
|
|
143
|
+
_remove(item) {
|
|
144
|
+
const index = this._array.indexOf(item);
|
|
145
|
+
if (index > -1) {
|
|
146
|
+
this._array.splice(index, 1);
|
|
147
|
+
}
|
|
148
|
+
return index;
|
|
149
|
+
}
|
|
150
|
+
|
|
138
151
|
/**
|
|
139
152
|
* Removes an item from the collection
|
|
140
153
|
* @param {T} item
|
|
141
154
|
* @api
|
|
142
155
|
*/
|
|
143
156
|
remove(item) {
|
|
144
|
-
const index = this.
|
|
157
|
+
const index = this._remove(item);
|
|
145
158
|
if (index > -1) {
|
|
146
|
-
this._array.splice(index, 1);
|
|
147
159
|
this.removed.raiseEvent(item);
|
|
148
160
|
}
|
|
149
161
|
}
|
package/src/util/extent.js
CHANGED