@vcmap/core 5.0.0-rc.3 → 5.0.0-rc.30
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/LICENSE.md +1 -1
- package/README.md +12 -5
- package/build/postinstall.js +14 -3
- package/index.d.ts +3477 -2007
- package/index.js +169 -131
- package/package.json +25 -27
- package/src/category/category.js +483 -0
- package/src/category/categoryCollection.js +153 -0
- package/src/cesium/cesium3DTileFeature.js +2 -2
- package/src/cesium/cesium3DTilePointFeature.js +1 -1
- package/src/cesium/cesiumVcsCameraPrimitive.js +16 -8
- package/src/cesium/entity.js +29 -0
- package/src/cesium/wallpaperMaterial.js +5 -3
- package/src/classRegistry.js +169 -0
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/abstractFeatureProvider.js +49 -46
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/tileProviderFeatureProvider.js +13 -5
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/wmsFeatureProvider.js +56 -26
- package/src/{vcs/vcm/interaction → interaction}/abstractInteraction.js +33 -21
- package/src/{vcs/vcm/interaction → interaction}/coordinateAtPixel.js +40 -21
- package/src/{vcs/vcm/interaction → interaction}/eventHandler.js +131 -26
- package/src/{vcs/vcm/interaction → interaction}/featureAtPixelInteraction.js +108 -53
- package/src/interaction/featureProviderInteraction.js +58 -0
- package/src/{vcs/vcm/interaction → interaction}/interactionChain.js +40 -41
- package/src/{vcs/vcm/interaction → interaction}/interactionType.js +24 -31
- package/src/{vcs/vcm/layer/cesium/cesiumTilesetCesium.js → layer/cesium/cesiumTilesetCesiumImpl.js} +67 -55
- package/src/{vcs/vcm/layer → layer}/cesium/clusterContext.js +33 -8
- package/src/{vcs/vcm/layer/cesium/dataSourceCesium.js → layer/cesium/dataSourceCesiumImpl.js} +24 -13
- package/src/layer/cesium/openStreetMapCesiumImpl.js +32 -0
- package/src/{vcs/vcm/layer/cesium/rasterLayerCesium.js → layer/cesium/rasterLayerCesiumImpl.js} +12 -9
- package/src/{vcs/vcm/layer/cesium/singleImageCesium.js → layer/cesium/singleImageCesiumImpl.js} +19 -9
- package/src/{vcs/vcm/layer/cesium/terrainCesium.js → layer/cesium/terrainCesiumImpl.js} +6 -6
- package/src/{vcs/vcm/layer/cesium/tmsCesium.js → layer/cesium/tmsCesiumImpl.js} +21 -10
- package/src/{vcs/vcm/layer/cesium/vectorCesium.js → layer/cesium/vectorCesiumImpl.js} +93 -35
- package/src/layer/cesium/vectorContext.js +363 -0
- package/src/{vcs/vcm/layer/cesium/vectorRasterTileCesium.js → layer/cesium/vectorRasterTileCesiumImpl.js} +21 -13
- package/src/{vcs/vcm/layer → layer}/cesium/vectorTileImageryProvider.js +58 -21
- package/src/{vcs/vcm/layer/cesium/wmsCesium.js → layer/cesium/wmsCesiumImpl.js} +20 -9
- package/src/{vcs/vcm/layer/cesium/wmtsCesium.js → layer/cesium/wmtsCesiumImpl.js} +24 -13
- package/src/{vcs/vcm/layer → layer}/cesium/x3dmHelper.js +6 -3
- package/src/{vcs/vcm/layer/cesiumTileset.js → layer/cesiumTilesetLayer.js} +71 -108
- package/src/{vcs/vcm/layer/czml.js → layer/czmlLayer.js} +23 -20
- package/src/{vcs/vcm/layer/dataSource.js → layer/dataSourceLayer.js} +55 -90
- package/src/{vcs/vcm/layer → layer}/featureLayer.js +89 -74
- package/src/{vcs/vcm/layer/featureStore.js → layer/featureStoreLayer.js} +197 -150
- package/src/{vcs/vcm/layer/featureStoreChanges.js → layer/featureStoreLayerChanges.js} +150 -92
- package/src/{vcs/vcm/layer/featureStoreState.js → layer/featureStoreLayerState.js} +1 -2
- package/src/{vcs/vcm/layer → layer}/featureVisibility.js +114 -82
- package/src/{vcs/vcm/layer → layer}/geojsonHelpers.js +84 -69
- package/src/{vcs/vcm/layer/geojson.js → layer/geojsonLayer.js} +30 -27
- package/src/{vcs/vcm/layer → layer}/globalHider.js +25 -39
- package/src/{vcs/vcm/layer → layer}/layer.js +171 -96
- package/src/{vcs/vcm/layer → layer}/layerImplementation.js +13 -6
- package/src/{vcs/vcm/layer → layer}/layerState.js +0 -1
- package/src/{vcs/vcm/layer → layer}/layerSymbols.js +2 -1
- package/src/{vcs/vcm/layer/oblique/layerOblique.js → layer/oblique/layerObliqueImpl.js} +7 -5
- package/src/{vcs/vcm/layer → layer}/oblique/obliqueHelpers.js +76 -31
- package/src/{vcs/vcm/layer/oblique/vectorOblique.js → layer/oblique/vectorObliqueImpl.js} +198 -80
- package/src/{vcs/vcm/layer/openStreetMap.js → layer/openStreetMapLayer.js} +59 -40
- package/src/layer/openlayers/layerOpenlayersImpl.js +165 -0
- package/src/layer/openlayers/openStreetMapOpenlayersImpl.js +28 -0
- package/src/layer/openlayers/rasterLayerOpenlayersImpl.js +44 -0
- package/src/{vcs/vcm/layer/openlayers/singleImageOpenlayers.js → layer/openlayers/singleImageOpenlayersImpl.js} +8 -7
- package/src/{vcs/vcm/layer/openlayers/tileDebugOpenlayers.js → layer/openlayers/tileDebugOpenlayersImpl.js} +7 -6
- package/src/{vcs/vcm/layer/openlayers/tmsOpenlayers.js → layer/openlayers/tmsOpenlayersImpl.js} +12 -10
- package/src/{vcs/vcm/layer/openlayers/vectorOpenlayers.js → layer/openlayers/vectorOpenlayersImpl.js} +21 -12
- package/src/{vcs/vcm/layer/openlayers/vectorTileOpenlayers.js → layer/openlayers/vectorTileOpenlayersImpl.js} +18 -12
- package/src/{vcs/vcm/layer/openlayers/wmsOpenlayers.js → layer/openlayers/wmsOpenlayersImpl.js} +9 -8
- package/src/{vcs/vcm/layer/openlayers/wmtsOpenlayers.js → layer/openlayers/wmtsOpenlayersImpl.js} +19 -12
- package/src/{vcs/vcm/layer/pointCloud.js → layer/pointCloudLayer.js} +42 -39
- package/src/{vcs/vcm/layer → layer}/rasterLayer.js +86 -37
- package/src/{vcs/vcm/layer/singleImage.js → layer/singleImageLayer.js} +25 -22
- package/src/layer/terrainHelpers.js +98 -0
- package/src/{vcs/vcm/layer/terrain.js → layer/terrainLayer.js} +26 -18
- package/src/{vcs/vcm/layer → layer}/tileLoadedHelper.js +13 -8
- package/src/{vcs/vcm/layer → layer}/tileProvider/mvtTileProvider.js +51 -8
- package/src/layer/tileProvider/staticGeojsonTileProvider.js +87 -0
- package/src/{vcs/vcm/layer → layer}/tileProvider/tileProvider.js +200 -89
- package/src/{vcs/vcm/layer → layer}/tileProvider/urlTemplateTileProvider.js +54 -13
- package/src/{vcs/vcm/layer/tms.js → layer/tmsLayer.js} +22 -22
- package/src/layer/vectorHelpers.js +129 -0
- package/src/{vcs/vcm/layer/vector.js → layer/vectorLayer.js} +124 -94
- package/src/{vcs/vcm/layer → layer}/vectorProperties.js +419 -107
- package/src/{vcs/vcm/layer → layer}/vectorSymbols.js +11 -1
- package/src/{vcs/vcm/layer/vectorTile.js → layer/vectorTileLayer.js} +181 -116
- package/src/{vcs/vcm/layer/wfs.js → layer/wfsLayer.js} +33 -23
- package/src/{vcs/vcm/layer → layer}/wmsHelpers.js +14 -7
- package/src/{vcs/vcm/layer/wms.js → layer/wmsLayer.js} +53 -32
- package/src/{vcs/vcm/layer/wmts.js → layer/wmtsLayer.js} +56 -42
- package/src/{vcs/vcm/maps → map}/baseOLMap.js +83 -35
- package/src/{vcs/vcm/maps → map}/cameraLimiter.js +75 -32
- package/src/{vcs/vcm/maps/cesium.js → map/cesiumMap.js} +429 -276
- package/src/{vcs/vcm/maps → map}/mapState.js +0 -1
- package/src/{vcs/vcm/maps/oblique.js → map/obliqueMap.js} +132 -97
- package/src/{vcs/vcm/maps/openlayers.js → map/openlayersMap.js} +69 -45
- package/src/{vcs/vcm/maps/map.js → map/vcsMap.js} +118 -46
- package/src/oblique/defaultObliqueCollection.js +62 -0
- package/src/{vcs/vcm/oblique → oblique}/helpers.js +221 -78
- package/src/{vcs/vcm/oblique/ObliqueCollection.js → oblique/obliqueCollection.js} +145 -54
- package/src/{vcs/vcm/oblique/ObliqueDataSet.js → oblique/obliqueDataSet.js} +62 -32
- package/src/{vcs/vcm/oblique/ObliqueImage.js → oblique/obliqueImage.js} +58 -26
- package/src/{vcs/vcm/oblique/ObliqueImageMeta.js → oblique/obliqueImageMeta.js} +9 -9
- package/src/{vcs/vcm/oblique/ObliqueProvider.js → oblique/obliqueProvider.js} +85 -35
- package/src/{vcs/vcm/oblique/ObliqueView.js → oblique/obliqueView.js} +45 -5
- package/src/{vcs/vcm/oblique/ObliqueViewDirection.js → oblique/obliqueViewDirection.js} +3 -5
- package/src/{vcs/vcm/oblique → oblique}/parseImageJson.js +62 -28
- package/src/ol/feature.js +34 -1
- package/src/ol/geom/circle.js +14 -5
- package/src/ol/geom/geometryCollection.js +14 -8
- package/src/ol/render/canvas/canvasTileRenderer.js +11 -10
- package/src/overrideClassRegistry.js +214 -0
- package/src/style/arcStyle.js +453 -0
- package/src/style/arrowStyle.js +304 -0
- package/src/{vcs/vcm/util/style → style}/declarativeStyleItem.js +147 -82
- package/src/{vcs/vcm/util/style → style}/shapesCategory.js +8 -8
- package/src/style/styleFactory.js +32 -0
- package/src/{vcs/vcm/util/style → style}/styleHelpers.js +24 -26
- package/src/style/styleItem.js +174 -0
- package/src/{vcs/vcm/util/style → style}/vectorStyleItem.js +230 -156
- package/src/{vcs/vcm/util/style → style}/writeStyle.js +7 -12
- package/src/{vcs/vcm/util → util}/clipping/clippingObject.js +84 -52
- package/src/{vcs/vcm/util → util}/clipping/clippingObjectManager.js +56 -23
- package/src/{vcs/vcm/util → util}/clipping/clippingPlaneHelper.js +149 -88
- package/src/{vcs/vcm/util → util}/collection.js +28 -10
- package/src/util/editor/createFeatureSession.js +195 -0
- package/src/util/editor/editFeaturesSession.js +325 -0
- package/src/util/editor/editGeometrySession.js +452 -0
- package/src/util/editor/editorHelpers.js +300 -0
- package/src/util/editor/editorSessionHelpers.js +132 -0
- package/src/util/editor/editorSymbols.js +21 -0
- package/src/util/editor/interactions/createBBoxInteraction.js +154 -0
- package/src/util/editor/interactions/createCircleInteraction.js +119 -0
- package/src/util/editor/interactions/createLineStringInteraction.js +119 -0
- package/src/util/editor/interactions/createPointInteraction.js +73 -0
- package/src/util/editor/interactions/createPolygonInteraction.js +136 -0
- package/src/util/editor/interactions/editFeaturesMouseOverInteraction.js +88 -0
- package/src/util/editor/interactions/editGeometryMouseOverInteraction.js +119 -0
- package/src/util/editor/interactions/ensureHandlerSelectionInteraction.js +50 -0
- package/src/util/editor/interactions/insertVertexInteraction.js +103 -0
- package/src/util/editor/interactions/mapInteractionController.js +119 -0
- package/src/util/editor/interactions/removeVertexInteraction.js +42 -0
- package/src/util/editor/interactions/selectFeatureMouseOverInteraction.js +152 -0
- package/src/util/editor/interactions/selectMultiFeatureInteraction.js +165 -0
- package/src/util/editor/interactions/selectSingleFeatureInteraction.js +120 -0
- package/src/util/editor/interactions/translateVertexInteraction.js +60 -0
- package/src/util/editor/selectFeaturesSession.js +303 -0
- package/src/util/editor/transformation/create2DHandlers.js +339 -0
- package/src/util/editor/transformation/create3DHandlers.js +678 -0
- package/src/util/editor/transformation/extrudeInteraction.js +106 -0
- package/src/util/editor/transformation/rotateInteraction.js +201 -0
- package/src/util/editor/transformation/scaleInteraction.js +201 -0
- package/src/util/editor/transformation/transformationHandler.js +178 -0
- package/src/util/editor/transformation/transformationTypes.js +88 -0
- package/src/util/editor/transformation/translateInteraction.js +263 -0
- package/src/util/editor/validateGeoemetry.js +24 -0
- package/src/{vcs/vcm/util → util}/exclusiveManager.js +6 -3
- package/src/{vcs/vcm/util → util}/extent.js +26 -20
- package/src/util/featureconverter/arcToCesium.js +121 -0
- package/src/{vcs/vcm/util → util}/featureconverter/circleToCesium.js +70 -37
- package/src/{vcs/vcm/util → util}/featureconverter/convert.js +94 -16
- package/src/util/featureconverter/extent3D.js +284 -0
- package/src/{vcs/vcm/util → util}/featureconverter/featureconverterHelper.js +253 -94
- package/src/util/featureconverter/lineStringToCesium.js +343 -0
- package/src/util/featureconverter/pointHelpers.js +413 -0
- package/src/{vcs/vcm/util → util}/featureconverter/pointToCesium.js +157 -107
- package/src/{vcs/vcm/util → util}/featureconverter/polygonToCesium.js +57 -24
- package/src/util/fetch.js +34 -0
- package/src/{vcs/vcm/util → util}/geometryHelpers.js +25 -17
- package/src/{vcs/vcm/util → util}/indexedCollection.js +27 -8
- package/src/{vcs/vcm/util → util}/isMobile.js +8 -2
- package/src/{vcs/vcm/util → util}/layerCollection.js +109 -19
- package/src/util/locale.js +12 -0
- package/src/{vcs/vcm/util → util}/mapCollection.js +170 -63
- package/src/util/math.js +193 -0
- package/src/util/overrideCollection.js +261 -0
- package/src/{vcs/vcm/util → util}/projection.js +23 -31
- package/src/{vcs/vcm/util → util}/urlHelpers.js +5 -3
- package/src/{vcs/vcm/util → util}/viewpoint.js +83 -57
- package/src/vcsApp.js +657 -0
- package/src/{vcs/vcm/event/vcsEvent.js → vcsEvent.js} +2 -3
- package/src/vcsModule.js +130 -0
- package/src/vcsModuleHelpers.js +136 -0
- package/src/{vcs/vcm/object.js → vcsObject.js} +3 -10
- package/tests/data/dynamicPointCzml.json +53 -0
- package/tests/data/oblique/imageData/imagev34.json +136 -0
- package/tests/data/oblique/imageData/imagev35.json +307 -0
- package/tests/data/oblique/imageData/imagev35PerImageSize.json +333 -0
- package/tests/data/oblique/tiledImageData/12/2199/1342.json +11056 -0
- package/tests/data/oblique/tiledImageData/12/2199/1343.json +11236 -0
- package/tests/data/oblique/tiledImageData/12/2199/1344.json +11077 -0
- package/tests/data/oblique/tiledImageData/12/2200/1342.json +11036 -0
- package/tests/data/oblique/tiledImageData/12/2200/1343.json +11277 -0
- package/tests/data/oblique/tiledImageData/12/2200/1344.json +11131 -0
- package/tests/data/oblique/tiledImageData/12/2201/1342.json +10870 -0
- package/tests/data/oblique/tiledImageData/12/2201/1343.json +11492 -0
- package/tests/data/oblique/tiledImageData/12/2201/1344.json +10909 -0
- package/tests/data/oblique/tiledImageData/image.json +70 -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 +127 -0
- package/tests/data/testGeoJSON.json +149 -0
- package/tests/data/tile.pbf +0 -0
- package/tests/unit/helpers/cesiumHelpers.js +326 -0
- package/tests/unit/helpers/getFileNameFromUrl.js +12 -0
- package/tests/unit/helpers/helpers.js +32 -0
- package/tests/unit/helpers/imageHelpers.js +24 -0
- package/tests/unit/helpers/importJSON.js +15 -0
- package/tests/unit/helpers/obliqueData.js +102 -0
- package/tests/unit/helpers/obliqueHelpers.js +115 -0
- package/tests/unit/helpers/openlayersHelpers.js +25 -0
- package/tests/unit/helpers/terrain/terrainData.js +47 -0
- package/src/vcs/vcm/classRegistry.js +0 -106
- package/src/vcs/vcm/globalCollections.js +0 -11
- package/src/vcs/vcm/interaction/featureProviderInteraction.js +0 -54
- package/src/vcs/vcm/layer/buildings.js +0 -17
- package/src/vcs/vcm/layer/cesium/openStreetMapCesium.js +0 -29
- package/src/vcs/vcm/layer/cesium/pointCloudCesium.js +0 -58
- package/src/vcs/vcm/layer/cesium/vectorContext.js +0 -167
- package/src/vcs/vcm/layer/openlayers/layerOpenlayers.js +0 -79
- package/src/vcs/vcm/layer/openlayers/openStreetMapOpenlayers.js +0 -27
- package/src/vcs/vcm/layer/openlayers/rasterLayerOpenlayers.js +0 -121
- package/src/vcs/vcm/layer/terrainHelpers.js +0 -119
- package/src/vcs/vcm/layer/tileProvider/staticGeojsonTileProvider.js +0 -67
- package/src/vcs/vcm/layer/tileProvider/tileProviderFactory.js +0 -28
- package/src/vcs/vcm/layer/vectorHelpers.js +0 -206
- package/src/vcs/vcm/util/dateTime.js +0 -60
- package/src/vcs/vcm/util/featureProvider/featureProviderHelpers.js +0 -51
- package/src/vcs/vcm/util/featureconverter/extent3d.js +0 -154
- package/src/vcs/vcm/util/featureconverter/lineStringToCesium.js +0 -171
- package/src/vcs/vcm/util/locale.js +0 -53
- package/src/vcs/vcm/util/math.js +0 -71
- package/src/vcs/vcm/util/splitScreen.js +0 -233
- package/src/vcs/vcm/util/style/styleFactory.js +0 -48
- package/src/vcs/vcm/util/style/styleItem.js +0 -243
- /package/src/{vcs/vcm/util/featureProvider → featureProvider}/featureProviderSymbols.js +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SplitDirection } from '@vcmap-cesium/engine';
|
|
2
2
|
|
|
3
3
|
import { parseNumberRange, parseInteger } from '@vcsuite/parsers';
|
|
4
4
|
import Layer from './layer.js';
|
|
5
|
-
import
|
|
6
|
-
import CesiumMap from '../
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import VcsEvent from '../
|
|
10
|
-
import {
|
|
5
|
+
import OpenlayersMap from '../map/openlayersMap.js';
|
|
6
|
+
import CesiumMap from '../map/cesiumMap.js';
|
|
7
|
+
import OpenStreetMapOpenlayersImpl from './openlayers/openStreetMapOpenlayersImpl.js';
|
|
8
|
+
import OpenStreetMapCesiumImpl from './cesium/openStreetMapCesiumImpl.js';
|
|
9
|
+
import VcsEvent from '../vcsEvent.js';
|
|
10
|
+
import { layerClassRegistry } from '../classRegistry.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @typedef {LayerOptions} OpenStreetMapOptions
|
|
@@ -18,15 +18,16 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* OpenStreetMapLayer Layer
|
|
22
22
|
* @class
|
|
23
|
-
* @export
|
|
24
23
|
* @extends {Layer}
|
|
25
24
|
* @api stable
|
|
26
25
|
* @implements {SplitLayer}
|
|
27
26
|
*/
|
|
28
|
-
class
|
|
29
|
-
static get className() {
|
|
27
|
+
class OpenStreetMapLayer extends Layer {
|
|
28
|
+
static get className() {
|
|
29
|
+
return 'OpenStreetMapLayer';
|
|
30
|
+
}
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* @returns {OpenStreetMapOptions}
|
|
@@ -45,33 +46,36 @@ class OpenStreetMap extends Layer {
|
|
|
45
46
|
*/
|
|
46
47
|
constructor(options) {
|
|
47
48
|
super(options);
|
|
48
|
-
const defaultOptions =
|
|
49
|
+
const defaultOptions = OpenStreetMapLayer.getDefaultOptions();
|
|
49
50
|
/**
|
|
50
|
-
* @type {import("@vcmap/
|
|
51
|
+
* @type {import("@vcmap-cesium/engine").SplitDirection}
|
|
51
52
|
* @private
|
|
52
53
|
*/
|
|
53
|
-
this._splitDirection =
|
|
54
|
+
this._splitDirection = SplitDirection.NONE;
|
|
54
55
|
|
|
55
56
|
if (options.splitDirection) {
|
|
56
|
-
this._splitDirection =
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
this._splitDirection =
|
|
58
|
+
options.splitDirection === 'left'
|
|
59
|
+
? SplitDirection.LEFT
|
|
60
|
+
: SplitDirection.RIGHT;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
this._supportedMaps = [
|
|
62
|
-
CesiumMap.className,
|
|
63
|
-
Openlayers.className,
|
|
64
|
-
];
|
|
63
|
+
this._supportedMaps = [CesiumMap.className, OpenlayersMap.className];
|
|
65
64
|
|
|
66
65
|
/**
|
|
67
66
|
* @type {number}
|
|
68
67
|
* @private
|
|
69
68
|
*/
|
|
70
|
-
this._opacity = parseNumberRange(
|
|
69
|
+
this._opacity = parseNumberRange(
|
|
70
|
+
options.opacity,
|
|
71
|
+
defaultOptions.opacity,
|
|
72
|
+
0.0,
|
|
73
|
+
1.0,
|
|
74
|
+
);
|
|
71
75
|
|
|
72
76
|
/**
|
|
73
77
|
* raised if the split direction changes, is passed the split direction as its only argument
|
|
74
|
-
* @type {VcsEvent<import("@vcmap/
|
|
78
|
+
* @type {VcsEvent<import("@vcmap-cesium/engine").SplitDirection>}
|
|
75
79
|
* @api
|
|
76
80
|
*/
|
|
77
81
|
this.splitDirectionChanged = new VcsEvent();
|
|
@@ -86,18 +90,20 @@ class OpenStreetMap extends Layer {
|
|
|
86
90
|
|
|
87
91
|
/**
|
|
88
92
|
* @api
|
|
89
|
-
* @type {import("@vcmap/
|
|
93
|
+
* @type {import("@vcmap-cesium/engine").SplitDirection}
|
|
90
94
|
*/
|
|
91
|
-
get splitDirection() {
|
|
95
|
+
get splitDirection() {
|
|
96
|
+
return this._splitDirection;
|
|
97
|
+
}
|
|
92
98
|
|
|
93
99
|
/**
|
|
94
|
-
* @param {import("@vcmap/
|
|
100
|
+
* @param {import("@vcmap-cesium/engine").SplitDirection} direction
|
|
95
101
|
*/
|
|
96
102
|
set splitDirection(direction) {
|
|
97
103
|
if (direction !== this._splitDirection) {
|
|
98
104
|
this._splitDirection = direction;
|
|
99
105
|
this.getImplementations().forEach((impl) => {
|
|
100
|
-
/** @type {
|
|
106
|
+
/** @type {OpenStreetMapCesiumImpl|OpenStreetMapOpenlayersImpl} */
|
|
101
107
|
(impl).updateSplitDirection(this._splitDirection);
|
|
102
108
|
});
|
|
103
109
|
this.splitDirectionChanged.raiseEvent(this._splitDirection);
|
|
@@ -109,7 +115,9 @@ class OpenStreetMap extends Layer {
|
|
|
109
115
|
* @api
|
|
110
116
|
* @type {number}
|
|
111
117
|
*/
|
|
112
|
-
get opacity() {
|
|
118
|
+
get opacity() {
|
|
119
|
+
return this._opacity;
|
|
120
|
+
}
|
|
113
121
|
|
|
114
122
|
/**
|
|
115
123
|
* @param {number} opacity
|
|
@@ -119,7 +127,7 @@ class OpenStreetMap extends Layer {
|
|
|
119
127
|
if (this._opacity !== parsedValue) {
|
|
120
128
|
this._opacity = parsedValue;
|
|
121
129
|
this.getImplementations().forEach((impl) => {
|
|
122
|
-
/** @type {
|
|
130
|
+
/** @type {OpenStreetMapCesiumImpl|OpenStreetMapOpenlayersImpl} */
|
|
123
131
|
(impl).updateOpacity(parsedValue);
|
|
124
132
|
});
|
|
125
133
|
}
|
|
@@ -143,15 +151,19 @@ class OpenStreetMap extends Layer {
|
|
|
143
151
|
/**
|
|
144
152
|
* @inheritDoc
|
|
145
153
|
* @param {import("@vcmap/core").VcsMap} map
|
|
146
|
-
* @returns {Array<
|
|
154
|
+
* @returns {Array<OpenStreetMapOpenlayersImpl|OpenStreetMapCesiumImpl>}
|
|
147
155
|
*/
|
|
148
156
|
createImplementationsForMap(map) {
|
|
149
|
-
if (map instanceof
|
|
150
|
-
return [
|
|
157
|
+
if (map instanceof OpenlayersMap) {
|
|
158
|
+
return [
|
|
159
|
+
new OpenStreetMapOpenlayersImpl(map, this.getImplementationOptions()),
|
|
160
|
+
];
|
|
151
161
|
}
|
|
152
162
|
|
|
153
163
|
if (map instanceof CesiumMap) {
|
|
154
|
-
return [
|
|
164
|
+
return [
|
|
165
|
+
new OpenStreetMapCesiumImpl(map, this.getImplementationOptions()),
|
|
166
|
+
];
|
|
155
167
|
}
|
|
156
168
|
return [];
|
|
157
169
|
}
|
|
@@ -162,12 +174,11 @@ class OpenStreetMap extends Layer {
|
|
|
162
174
|
*/
|
|
163
175
|
toJSON() {
|
|
164
176
|
const config = /** @type {OpenStreetMapOptions} */ (super.toJSON());
|
|
165
|
-
const defaultOptions =
|
|
177
|
+
const defaultOptions = OpenStreetMapLayer.getDefaultOptions();
|
|
166
178
|
|
|
167
|
-
if (this._splitDirection !==
|
|
168
|
-
config.splitDirection =
|
|
169
|
-
'right' :
|
|
170
|
-
'left';
|
|
179
|
+
if (this._splitDirection !== SplitDirection.NONE) {
|
|
180
|
+
config.splitDirection =
|
|
181
|
+
this._splitDirection === SplitDirection.RIGHT ? 'right' : 'left';
|
|
171
182
|
}
|
|
172
183
|
|
|
173
184
|
if (this.opacity !== defaultOptions.opacity) {
|
|
@@ -178,6 +189,11 @@ class OpenStreetMap extends Layer {
|
|
|
178
189
|
config.maxLevel = this.maxLevel;
|
|
179
190
|
}
|
|
180
191
|
|
|
192
|
+
if (this._splitDirection !== SplitDirection.NONE) {
|
|
193
|
+
config.splitDirection =
|
|
194
|
+
this._splitDirection === SplitDirection.RIGHT ? 'right' : 'left';
|
|
195
|
+
}
|
|
196
|
+
|
|
181
197
|
return config;
|
|
182
198
|
}
|
|
183
199
|
|
|
@@ -190,5 +206,8 @@ class OpenStreetMap extends Layer {
|
|
|
190
206
|
}
|
|
191
207
|
}
|
|
192
208
|
|
|
193
|
-
|
|
194
|
-
|
|
209
|
+
layerClassRegistry.registerClass(
|
|
210
|
+
OpenStreetMapLayer.className,
|
|
211
|
+
OpenStreetMapLayer,
|
|
212
|
+
);
|
|
213
|
+
export default OpenStreetMapLayer;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { SplitDirection } from '@vcmap-cesium/engine';
|
|
2
|
+
import { unByKey } from 'ol/Observable.js';
|
|
3
|
+
import { vcsLayerName } from '../layerSymbols.js';
|
|
4
|
+
import LayerImplementation from '../layerImplementation.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {LayerImplementationOptions} LayerOpenlayersImplementationOptions
|
|
8
|
+
* @property {import("@vcmap-cesium/engine").SplitDirection} splitDirection
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Layer implementation for {@link OpenlayersMap}.
|
|
13
|
+
* @class
|
|
14
|
+
* @extends {LayerImplementation<import("@vcmap/core").OpenlayersMap>}}
|
|
15
|
+
*/
|
|
16
|
+
class LayerOpenlayersImpl extends LayerImplementation {
|
|
17
|
+
static get className() {
|
|
18
|
+
return 'LayerOpenlayersImpl';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
23
|
+
* @param {LayerOpenlayersImplementationOptions} options
|
|
24
|
+
*/
|
|
25
|
+
constructor(map, options) {
|
|
26
|
+
super(map, options);
|
|
27
|
+
/**
|
|
28
|
+
* @type {import("ol/layer").Layer<import("ol/source/Source").default>|null}
|
|
29
|
+
*/
|
|
30
|
+
this.olLayer = null;
|
|
31
|
+
/** @type {import("@vcmap-cesium/engine").SplitDirection} */
|
|
32
|
+
this.splitDirection = options.splitDirection;
|
|
33
|
+
/**
|
|
34
|
+
* @type {Array<import("ol/events").EventsKey>|null}
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
this._splitDirectionRenderListeners = null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @inheritDoc
|
|
42
|
+
* @returns {Promise<void>}
|
|
43
|
+
*/
|
|
44
|
+
async initialize() {
|
|
45
|
+
if (!this.initialized) {
|
|
46
|
+
this.olLayer = this.getOLLayer();
|
|
47
|
+
this.olLayer[vcsLayerName] = this.name;
|
|
48
|
+
this.map.addOLLayer(this.olLayer);
|
|
49
|
+
}
|
|
50
|
+
await super.initialize();
|
|
51
|
+
this.updateSplitDirection(this.splitDirection);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @inheritDoc
|
|
56
|
+
* @returns {Promise<void>}
|
|
57
|
+
*/
|
|
58
|
+
async activate() {
|
|
59
|
+
await super.activate();
|
|
60
|
+
if (this.active) {
|
|
61
|
+
this.olLayer.setVisible(true);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @inheritDoc
|
|
67
|
+
*/
|
|
68
|
+
deactivate() {
|
|
69
|
+
super.deactivate();
|
|
70
|
+
if (this.olLayer) {
|
|
71
|
+
this.olLayer.setVisible(false);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// eslint-disable-next-line jsdoc/require-returns-check
|
|
76
|
+
/**
|
|
77
|
+
* returns the ol Layer
|
|
78
|
+
* @returns {import("ol/layer").Layer<import("ol/source/Source").default>}
|
|
79
|
+
*/
|
|
80
|
+
// eslint-disable-next-line class-methods-use-this
|
|
81
|
+
getOLLayer() {
|
|
82
|
+
throw new Error();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @param {import("@vcmap-cesium/engine").SplitDirection} splitDirection
|
|
87
|
+
*/
|
|
88
|
+
updateSplitDirection(splitDirection) {
|
|
89
|
+
this.splitDirection = splitDirection;
|
|
90
|
+
if (this.initialized) {
|
|
91
|
+
if (
|
|
92
|
+
this.splitDirection === SplitDirection.NONE &&
|
|
93
|
+
this._splitDirectionRenderListeners
|
|
94
|
+
) {
|
|
95
|
+
unByKey(this._splitDirectionRenderListeners);
|
|
96
|
+
this._splitDirectionRenderListeners = null;
|
|
97
|
+
this.olLayer.changed();
|
|
98
|
+
} else if (
|
|
99
|
+
splitDirection !== SplitDirection.NONE &&
|
|
100
|
+
!this._splitDirectionRenderListeners
|
|
101
|
+
) {
|
|
102
|
+
this._splitDirectionRenderListeners = [];
|
|
103
|
+
this._splitDirectionRenderListeners.push(
|
|
104
|
+
/** @type {import("ol/events").EventsKey} */
|
|
105
|
+
(this.olLayer.on('prerender', this._splitPreRender.bind(this))),
|
|
106
|
+
);
|
|
107
|
+
this._splitDirectionRenderListeners.push(
|
|
108
|
+
/** @type {import("ol/events").EventsKey} */
|
|
109
|
+
(
|
|
110
|
+
this.olLayer.on(
|
|
111
|
+
'postrender',
|
|
112
|
+
(/** @type {import("ol/render/Event").default} */ event) => {
|
|
113
|
+
/** @type {CanvasRenderingContext2D} */ (
|
|
114
|
+
event.context
|
|
115
|
+
).restore();
|
|
116
|
+
},
|
|
117
|
+
)
|
|
118
|
+
),
|
|
119
|
+
);
|
|
120
|
+
this.olLayer.changed();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @param {import("ol/render/Event").default} event
|
|
127
|
+
* @private
|
|
128
|
+
*/
|
|
129
|
+
_splitPreRender(event) {
|
|
130
|
+
// eslint-disable-next-line prefer-destructuring
|
|
131
|
+
const context = /** @type {CanvasRenderingContext2D} */ (event.context);
|
|
132
|
+
const width = context.canvas.width * this.map.splitPosition;
|
|
133
|
+
context.save();
|
|
134
|
+
context.beginPath();
|
|
135
|
+
|
|
136
|
+
if (this.splitDirection === SplitDirection.LEFT) {
|
|
137
|
+
context.rect(0, 0, width, context.canvas.height);
|
|
138
|
+
} else {
|
|
139
|
+
context.rect(
|
|
140
|
+
width,
|
|
141
|
+
0,
|
|
142
|
+
context.canvas.width - width,
|
|
143
|
+
context.canvas.height,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
context.clip();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @inheritDoc
|
|
151
|
+
*/
|
|
152
|
+
destroy() {
|
|
153
|
+
if (this.olLayer) {
|
|
154
|
+
this.map.removeOLLayer(this.olLayer);
|
|
155
|
+
}
|
|
156
|
+
this.olLayer = null;
|
|
157
|
+
if (this._splitDirectionRenderListeners) {
|
|
158
|
+
unByKey(this._splitDirectionRenderListeners);
|
|
159
|
+
this._splitDirectionRenderListeners = null;
|
|
160
|
+
}
|
|
161
|
+
super.destroy();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export default LayerOpenlayersImpl;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Tile from 'ol/layer/Tile.js';
|
|
2
|
+
import OSM from 'ol/source/OSM.js';
|
|
3
|
+
import RasterLayerOpenlayersImpl from './rasterLayerOpenlayersImpl.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* represents a specific OpenStreetMapLayer layer for openlayers.
|
|
7
|
+
* @class
|
|
8
|
+
* @extends {RasterLayerOpenlayersImpl}
|
|
9
|
+
*/
|
|
10
|
+
class OpenStreetMapOpenlayersImpl extends RasterLayerOpenlayersImpl {
|
|
11
|
+
static get className() {
|
|
12
|
+
return 'OpenStreetMapOpenlayersImpl';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @returns {import("ol/layer/Tile").default}
|
|
17
|
+
*/
|
|
18
|
+
getOLLayer() {
|
|
19
|
+
return new Tile({
|
|
20
|
+
opacity: this.opacity,
|
|
21
|
+
source: new OSM({
|
|
22
|
+
maxZoom: this.maxLevel,
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default OpenStreetMapOpenlayersImpl;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import LayerOpenlayersImpl from './layerOpenlayersImpl.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* RasterLayer implementation for {@link Openlayers}
|
|
5
|
+
* @class
|
|
6
|
+
* @extends {LayerOpenlayersImpl}
|
|
7
|
+
* @implements {RasterLayerImplementation}
|
|
8
|
+
* @abstract
|
|
9
|
+
*/
|
|
10
|
+
class RasterLayerOpenlayersImpl extends LayerOpenlayersImpl {
|
|
11
|
+
static get className() {
|
|
12
|
+
return 'RasterLayerOpenlayersImpl';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
17
|
+
* @param {RasterLayerImplementationOptions} options
|
|
18
|
+
*/
|
|
19
|
+
constructor(map, options) {
|
|
20
|
+
super(map, options);
|
|
21
|
+
/** @type {number} */
|
|
22
|
+
this.minLevel = options.minLevel;
|
|
23
|
+
/** @type {number} */
|
|
24
|
+
this.maxLevel = options.maxLevel;
|
|
25
|
+
/** @type {string} */
|
|
26
|
+
this.tilingSchema = options.tilingSchema;
|
|
27
|
+
/** @type {import("@vcmap/core").Extent} */
|
|
28
|
+
this.extent = options.extent;
|
|
29
|
+
/** @type {number} */
|
|
30
|
+
this.opacity = options.opacity;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param {number} opacity
|
|
35
|
+
*/
|
|
36
|
+
updateOpacity(opacity) {
|
|
37
|
+
this.opacity = opacity;
|
|
38
|
+
if (this.initialized) {
|
|
39
|
+
this.olLayer.setOpacity(this.opacity);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default RasterLayerOpenlayersImpl;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import ImageLayer from 'ol/layer/Image.js';
|
|
2
2
|
import ImageStatic from 'ol/source/ImageStatic.js';
|
|
3
|
-
import
|
|
3
|
+
import RasterLayerOpenlayersImpl from './rasterLayerOpenlayersImpl.js';
|
|
4
4
|
import { wgs84Projection } from '../../util/projection.js';
|
|
5
5
|
import { isSameOrigin } from '../../util/urlHelpers.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* represents a specific OpenLayers SingleImageLayer Layer class.
|
|
9
9
|
* @class
|
|
10
|
-
* @
|
|
11
|
-
* @extends {RasterLayerOpenlayers}
|
|
10
|
+
* @extends {RasterLayerOpenlayersImpl}
|
|
12
11
|
*/
|
|
13
|
-
class
|
|
14
|
-
static get className() {
|
|
12
|
+
class SingleImageOpenlayersImpl extends RasterLayerOpenlayersImpl {
|
|
13
|
+
static get className() {
|
|
14
|
+
return 'SingleImageOpenlayersImpl';
|
|
15
|
+
}
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
|
-
* @param {import("@vcmap/core").
|
|
18
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
18
19
|
* @param {SingleImageImplementationOptions} options
|
|
19
20
|
*/
|
|
20
21
|
constructor(map, options) {
|
|
@@ -46,4 +47,4 @@ class SingleImageOpenlayers extends RasterLayerOpenlayers {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
export default
|
|
50
|
+
export default SingleImageOpenlayersImpl;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import Tile from 'ol/layer/Tile.js';
|
|
2
2
|
import TileDebug from 'ol/source/TileDebug.js';
|
|
3
|
-
import
|
|
3
|
+
import LayerOpenlayersImpl from './layerOpenlayersImpl.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* layer Implementation to render tile boundaries.
|
|
7
7
|
* @class
|
|
8
|
-
* @
|
|
9
|
-
* @extends {LayerOpenlayers}
|
|
8
|
+
* @extends {LayerOpenlayersImpl}
|
|
10
9
|
* @implements {VectorTileImplementation}
|
|
11
10
|
*/
|
|
12
|
-
class
|
|
13
|
-
static get className() {
|
|
11
|
+
class TileDebugOpenlayersImpl extends LayerOpenlayersImpl {
|
|
12
|
+
static get className() {
|
|
13
|
+
return 'TileDebugOpenlayersImpl';
|
|
14
|
+
}
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* @returns {import("ol/layer/Tile").default}
|
|
@@ -36,4 +37,4 @@ class TileDebugOpenlayers extends LayerOpenlayers {
|
|
|
36
37
|
updateTiles(args) {}
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
export default
|
|
40
|
+
export default TileDebugOpenlayersImpl;
|
package/src/{vcs/vcm/layer/openlayers/tmsOpenlayers.js → layer/openlayers/tmsOpenlayersImpl.js}
RENAMED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import XYZ from 'ol/source/XYZ.js';
|
|
2
2
|
import Tile from 'ol/layer/Tile.js';
|
|
3
3
|
import { mercatorProjection } from '../../util/projection.js';
|
|
4
|
-
import
|
|
4
|
+
import RasterLayerOpenlayersImpl from './rasterLayerOpenlayersImpl.js';
|
|
5
5
|
import { TilingScheme } from '../rasterLayer.js';
|
|
6
6
|
import { isSameOrigin } from '../../util/urlHelpers.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* TmsLayer implementation for {@link Openlayers}.
|
|
10
10
|
* @class
|
|
11
|
-
* @
|
|
12
|
-
* @extends {RasterLayerOpenlayers}
|
|
11
|
+
* @extends {RasterLayerOpenlayersImpl}
|
|
13
12
|
*/
|
|
14
|
-
class
|
|
15
|
-
static get className() {
|
|
13
|
+
class TmsOpenlayersImpl extends RasterLayerOpenlayersImpl {
|
|
14
|
+
static get className() {
|
|
15
|
+
return 'TmsOpenlayersImpl';
|
|
16
|
+
}
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
|
-
* @param {import("@vcmap/core").
|
|
19
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
19
20
|
* @param {TMSImplementationOptions} options
|
|
20
21
|
*/
|
|
21
22
|
constructor(map, options) {
|
|
@@ -33,7 +34,7 @@ class TMSOpenlayers extends RasterLayerOpenlayers {
|
|
|
33
34
|
const sourceOptions = {
|
|
34
35
|
tileUrlFunction: (tileCoord) => {
|
|
35
36
|
const baseUrl = this.url.replace(/\/$/, '');
|
|
36
|
-
const y = (1 << tileCoord[0]) -
|
|
37
|
+
const y = (1 << tileCoord[0]) - tileCoord[2] - 1;
|
|
37
38
|
return `${baseUrl}/${tileCoord[0]}/${tileCoord[1]}/${y}.${this.format}`;
|
|
38
39
|
},
|
|
39
40
|
tileSize: this.tileSize,
|
|
@@ -53,10 +54,11 @@ class TMSOpenlayers extends RasterLayerOpenlayers {
|
|
|
53
54
|
opacity: this.opacity,
|
|
54
55
|
};
|
|
55
56
|
if (this.extent && this.extent.isValid()) {
|
|
56
|
-
tileOptions.extent =
|
|
57
|
+
tileOptions.extent =
|
|
58
|
+
this.extent.getCoordinatesInProjection(mercatorProjection);
|
|
57
59
|
}
|
|
58
60
|
return new Tile(tileOptions);
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
export default
|
|
64
|
+
export default TmsOpenlayersImpl;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import OLVectorLayer from 'ol/layer/Vector.js';
|
|
2
|
-
import
|
|
2
|
+
import LayerOpenlayersImpl from './layerOpenlayersImpl.js';
|
|
3
3
|
import { synchronizeFeatureVisibilityWithSource } from '../vectorHelpers.js';
|
|
4
|
-
import { getGlobalHider } from '../globalHider.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* represents a specific vectorlayer for openlayers.
|
|
8
7
|
* @class
|
|
9
|
-
* @export
|
|
10
8
|
* @implements {FeatureLayerImplementation}
|
|
11
|
-
* @extends {
|
|
9
|
+
* @extends {LayerOpenlayersImpl}
|
|
12
10
|
*/
|
|
13
|
-
class
|
|
14
|
-
static get className() {
|
|
11
|
+
class VectorOpenlayersImpl extends LayerOpenlayersImpl {
|
|
12
|
+
static get className() {
|
|
13
|
+
return 'VectorOpenlayersImpl';
|
|
14
|
+
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* @param {import("@vcmap/core").
|
|
17
|
+
* @param {import("@vcmap/core").OpenlayersMap} map
|
|
18
18
|
* @param {VectorImplementationOptions} options
|
|
19
19
|
*/
|
|
20
20
|
constructor(map, options) {
|
|
@@ -36,7 +36,8 @@ class VectorOpenlayers extends LayerOpenlayers {
|
|
|
36
36
|
this._featureVisibilityListeners = [];
|
|
37
37
|
/** @type {import("ol/layer/Vector").default<import("ol/source").Vector<import("ol/geom/Geometry").default>>|null} */
|
|
38
38
|
this.olLayer = null;
|
|
39
|
-
|
|
39
|
+
/** @type {import("@vcmap/core").GlobalHider} */
|
|
40
|
+
this.globalHider = options.globalHider;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
/**
|
|
@@ -81,7 +82,11 @@ class VectorOpenlayers extends LayerOpenlayers {
|
|
|
81
82
|
if (this.active) {
|
|
82
83
|
if (this._featureVisibilityListeners.length === 0) {
|
|
83
84
|
this._featureVisibilityListeners =
|
|
84
|
-
synchronizeFeatureVisibilityWithSource(
|
|
85
|
+
synchronizeFeatureVisibilityWithSource(
|
|
86
|
+
this.featureVisibility,
|
|
87
|
+
this.source,
|
|
88
|
+
this.globalHider,
|
|
89
|
+
);
|
|
85
90
|
}
|
|
86
91
|
}
|
|
87
92
|
}
|
|
@@ -92,7 +97,9 @@ class VectorOpenlayers extends LayerOpenlayers {
|
|
|
92
97
|
*/
|
|
93
98
|
deactivate() {
|
|
94
99
|
super.deactivate();
|
|
95
|
-
this._featureVisibilityListeners.forEach((cb) => {
|
|
100
|
+
this._featureVisibilityListeners.forEach((cb) => {
|
|
101
|
+
cb();
|
|
102
|
+
});
|
|
96
103
|
this._featureVisibilityListeners = [];
|
|
97
104
|
}
|
|
98
105
|
|
|
@@ -109,10 +116,12 @@ class VectorOpenlayers extends LayerOpenlayers {
|
|
|
109
116
|
* @inheritDoc
|
|
110
117
|
*/
|
|
111
118
|
destroy() {
|
|
112
|
-
this._featureVisibilityListeners.forEach((cb) => {
|
|
119
|
+
this._featureVisibilityListeners.forEach((cb) => {
|
|
120
|
+
cb();
|
|
121
|
+
});
|
|
113
122
|
this._featureVisibilityListeners = [];
|
|
114
123
|
super.destroy();
|
|
115
124
|
}
|
|
116
125
|
}
|
|
117
126
|
|
|
118
|
-
export default
|
|
127
|
+
export default VectorOpenlayersImpl;
|