@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
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { unByKey } from 'ol/Observable.js';
|
|
2
|
+
import { FeatureVisibilityAction } from './featureVisibility.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Added to ol.source.Vector to determine, when the source has last had an update to its features visibility.
|
|
6
|
+
* @type {symbol}
|
|
7
|
+
*/
|
|
8
|
+
export const fvLastUpdated = Symbol('FVlastUpdated');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Added to ol.source.Vector to determine, when the source has last had an update to its features global visibility.
|
|
12
|
+
* @type {symbol}
|
|
13
|
+
*/
|
|
14
|
+
export const globalHiderLastUpdated = Symbol('GlobalHiderLastUpdated');
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @param {import("@vcmap/core").FeatureVisibility} featureVisibility
|
|
18
|
+
* @param {import("ol/source").Vector<import("ol/geom/Geometry").default>} source
|
|
19
|
+
*/
|
|
20
|
+
export function updateFeatureVisibility(featureVisibility, source) {
|
|
21
|
+
Object.keys(featureVisibility.highlightedObjects).forEach((id) => {
|
|
22
|
+
const feat = source.getFeatureById(id);
|
|
23
|
+
if (feat && !featureVisibility.hasHighlightFeature(id, feat)) {
|
|
24
|
+
featureVisibility.addHighlightFeature(id, feat);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
Object.keys(featureVisibility.hiddenObjects).forEach((id) => {
|
|
29
|
+
const feat = source.getFeatureById(id);
|
|
30
|
+
if (feat && !featureVisibility.hasHiddenFeature(id, feat)) {
|
|
31
|
+
featureVisibility.addHiddenFeature(id, feat);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
source[fvLastUpdated] = Date.now();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @param {import("@vcmap/core").GlobalHider} globalHider
|
|
39
|
+
* @param {import("ol/source").Vector<import("ol/geom/Geometry").default>} source
|
|
40
|
+
*/
|
|
41
|
+
export function updateGlobalHider(globalHider, source) {
|
|
42
|
+
Object.keys(globalHider.hiddenObjects).forEach((id) => {
|
|
43
|
+
const feat = source.getFeatureById(id);
|
|
44
|
+
if (feat && !globalHider.hasFeature(id, feat)) {
|
|
45
|
+
globalHider.addFeature(id, feat);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
source[globalHiderLastUpdated] = Date.now();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @param {import("@vcmap/core").FeatureVisibility} featureVisibility
|
|
53
|
+
* @param {import("ol/source").Vector<import("ol/geom/Geometry").default>} source
|
|
54
|
+
* @param {import("@vcmap/core").GlobalHider} globalHider
|
|
55
|
+
* @returns {Array<Function>}
|
|
56
|
+
*/
|
|
57
|
+
export function synchronizeFeatureVisibilityWithSource(
|
|
58
|
+
featureVisibility,
|
|
59
|
+
source,
|
|
60
|
+
globalHider,
|
|
61
|
+
) {
|
|
62
|
+
const sourceListener = source.on('addfeature', ({ feature }) => {
|
|
63
|
+
const id = feature.getId();
|
|
64
|
+
if (featureVisibility.highlightedObjects[id]) {
|
|
65
|
+
featureVisibility.addHighlightFeature(id, feature);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (featureVisibility.hiddenObjects[id]) {
|
|
69
|
+
featureVisibility.addHiddenFeature(id, feature);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (globalHider.hiddenObjects[id]) {
|
|
73
|
+
globalHider.addFeature(id, feature);
|
|
74
|
+
}
|
|
75
|
+
const now = Date.now();
|
|
76
|
+
source[fvLastUpdated] = now;
|
|
77
|
+
source[globalHiderLastUpdated] = now;
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
if (
|
|
81
|
+
!source[fvLastUpdated] ||
|
|
82
|
+
source[fvLastUpdated] < featureVisibility.lastUpdated
|
|
83
|
+
) {
|
|
84
|
+
updateFeatureVisibility(featureVisibility, source);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (
|
|
88
|
+
!source[globalHiderLastUpdated] ||
|
|
89
|
+
source[globalHiderLastUpdated] < featureVisibility.lastUpdated
|
|
90
|
+
) {
|
|
91
|
+
updateGlobalHider(globalHider, source);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return [
|
|
95
|
+
featureVisibility.changed.addEventListener(({ action, ids }) => {
|
|
96
|
+
if (action === FeatureVisibilityAction.HIGHLIGHT) {
|
|
97
|
+
ids.forEach((id) => {
|
|
98
|
+
const feat = source.getFeatureById(id);
|
|
99
|
+
if (feat) {
|
|
100
|
+
featureVisibility.addHighlightFeature(id, feat);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
source[fvLastUpdated] = Date.now();
|
|
104
|
+
} else if (action === FeatureVisibilityAction.HIDE) {
|
|
105
|
+
ids.forEach((id) => {
|
|
106
|
+
const feat = source.getFeatureById(id);
|
|
107
|
+
if (feat) {
|
|
108
|
+
featureVisibility.addHiddenFeature(id, feat);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
source[fvLastUpdated] = Date.now();
|
|
112
|
+
}
|
|
113
|
+
}),
|
|
114
|
+
globalHider.changed.addEventListener(({ action, ids }) => {
|
|
115
|
+
if (action === FeatureVisibilityAction.HIDE) {
|
|
116
|
+
ids.forEach((id) => {
|
|
117
|
+
const feat = source.getFeatureById(id);
|
|
118
|
+
if (feat) {
|
|
119
|
+
globalHider.addFeature(id, feat);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
source[globalHiderLastUpdated] = Date.now();
|
|
123
|
+
}
|
|
124
|
+
}),
|
|
125
|
+
() => {
|
|
126
|
+
unByKey(sourceListener);
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
}
|
|
@@ -4,11 +4,17 @@ import Feature from 'ol/Feature.js';
|
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid';
|
|
5
5
|
import { check } from '@vcsuite/check';
|
|
6
6
|
import { parseBoolean } from '@vcsuite/parsers';
|
|
7
|
-
import Projection, {
|
|
7
|
+
import Projection, {
|
|
8
|
+
getDefaultProjection,
|
|
9
|
+
mercatorProjection,
|
|
10
|
+
} from '../util/projection.js';
|
|
8
11
|
import Layer, { vcsMetaVersion } from './layer.js';
|
|
9
|
-
import VectorStyleItem, {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
import VectorStyleItem, {
|
|
13
|
+
defaultVectorStyle,
|
|
14
|
+
vectorStyleSymbol,
|
|
15
|
+
} from '../style/vectorStyleItem.js';
|
|
16
|
+
import DeclarativeStyleItem from '../style/declarativeStyleItem.js';
|
|
17
|
+
import writeStyle from '../style/writeStyle.js';
|
|
12
18
|
import {
|
|
13
19
|
alreadyTransformedToImage,
|
|
14
20
|
alreadyTransformedToMercator,
|
|
@@ -19,16 +25,15 @@ import {
|
|
|
19
25
|
import Extent from '../util/extent.js';
|
|
20
26
|
import VectorProperties from './vectorProperties.js';
|
|
21
27
|
import FeatureLayer from './featureLayer.js';
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import CesiumMap from '../
|
|
28
|
+
import OpenlayersMap from '../map/openlayersMap.js';
|
|
29
|
+
import VectorOpenlayersImpl from './openlayers/vectorOpenlayersImpl.js';
|
|
30
|
+
import VectorCesiumImpl from './cesium/vectorCesiumImpl.js';
|
|
31
|
+
import VectorObliqueImpl from './oblique/vectorObliqueImpl.js';
|
|
32
|
+
import ObliqueMap from '../map/obliqueMap.js';
|
|
33
|
+
import CesiumMap from '../map/cesiumMap.js';
|
|
28
34
|
import { originalStyle, updateOriginalStyle } from './featureVisibility.js';
|
|
29
|
-
import StyleItem
|
|
30
|
-
import {
|
|
31
|
-
import { VcsClassRegistry } from '../classRegistry.js';
|
|
35
|
+
import StyleItem from '../style/styleItem.js';
|
|
36
|
+
import { layerClassRegistry } from '../classRegistry.js';
|
|
32
37
|
|
|
33
38
|
/**
|
|
34
39
|
* @typedef {FeatureLayerOptions} VectorOptions
|
|
@@ -47,11 +52,11 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
47
52
|
* @typedef {Object} VectorGeometryFactoryType
|
|
48
53
|
* @property {function(Array<import("ol/geom/SimpleGeometry").default>):Array<import("ol/coordinate").Coordinate>} getCoordinates
|
|
49
54
|
* @property {function(import("ol/geom/SimpleGeometry").default, number):Object} getGeometryOptions
|
|
50
|
-
* @property {function(Object, number, boolean, number=):Array<import("@vcmap/
|
|
51
|
-
* @property {function(Object, number, boolean, number=):Array<import("@vcmap/
|
|
52
|
-
* @property {function(Object, number, boolean):Array<import("@vcmap/
|
|
53
|
-
* @property {function(Object, import("ol/style/Style").default):Array<import("@vcmap/
|
|
54
|
-
* @property {function(Object, import("ol/style/Style").default):Array<import("@vcmap/
|
|
55
|
+
* @property {function(Object, number, boolean, number=):Array<import("@vcmap-cesium/engine").PolygonGeometry|import("@vcmap-cesium/engine").CircleGeometry|import("@vcmap-cesium/engine").WallGeometry>} createSolidGeometries
|
|
56
|
+
* @property {function(Object, number, boolean, number=):Array<import("@vcmap-cesium/engine").CircleOutlineGeometry|import("@vcmap-cesium/engine").WallOutlineGeometry|import("@vcmap-cesium/engine").PolygonOutlineGeometry>} createOutlineGeometries
|
|
57
|
+
* @property {function(Object, number, boolean):Array<import("@vcmap-cesium/engine").CircleGeometry|import("@vcmap-cesium/engine").PolygonGeometry>} createFillGeometries
|
|
58
|
+
* @property {function(Object, import("ol/style/Style").default):Array<import("@vcmap-cesium/engine").GroundPolylineGeometry>} createGroundLineGeometries
|
|
59
|
+
* @property {function(Object, import("ol/style/Style").default):Array<import("@vcmap-cesium/engine").PolylineGeometry>} createLineGeometries
|
|
55
60
|
* @api
|
|
56
61
|
*/
|
|
57
62
|
|
|
@@ -63,7 +68,7 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
63
68
|
* @property {number} groundLevel - the level above or below mean sea level (minZ value or ground_level or 0)
|
|
64
69
|
* @property {number} skirt - a negative height to <i>push</i> the geometry visually into the ground
|
|
65
70
|
* @property {boolean} perPositionHeight
|
|
66
|
-
* @property {import("@vcmap/
|
|
71
|
+
* @property {import("@vcmap-cesium/engine").HeightReference} heightReference heightReference of the feature.
|
|
67
72
|
* @property {number} heightAboveGroundAdjustment
|
|
68
73
|
* @api
|
|
69
74
|
*/
|
|
@@ -82,48 +87,60 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
82
87
|
*/
|
|
83
88
|
|
|
84
89
|
/**
|
|
85
|
-
*
|
|
90
|
+
* VectorLayer Layer for OpenlayersMap, Cesium and ObliqueMap
|
|
86
91
|
* @class
|
|
87
|
-
* @export
|
|
88
92
|
* @extends {FeatureLayer}
|
|
93
|
+
* @implements {SplitLayer}
|
|
89
94
|
* @api stable
|
|
90
95
|
*/
|
|
91
|
-
class
|
|
96
|
+
class VectorLayer extends FeatureLayer {
|
|
92
97
|
/**
|
|
93
98
|
* @readonly
|
|
94
99
|
* @returns {string}
|
|
95
100
|
*/
|
|
96
|
-
static get className() {
|
|
101
|
+
static get className() {
|
|
102
|
+
return 'VectorLayer';
|
|
103
|
+
}
|
|
97
104
|
|
|
98
105
|
/**
|
|
99
106
|
* @returns {symbol}
|
|
100
107
|
* @readonly
|
|
101
108
|
*/
|
|
102
|
-
static get alreadyTransformedToMercator() {
|
|
109
|
+
static get alreadyTransformedToMercator() {
|
|
110
|
+
return alreadyTransformedToMercator;
|
|
111
|
+
}
|
|
103
112
|
|
|
104
113
|
/**
|
|
105
114
|
* @returns {symbol}
|
|
106
115
|
* @readonly
|
|
107
116
|
*/
|
|
108
|
-
static get alreadyTransformedToImage() {
|
|
117
|
+
static get alreadyTransformedToImage() {
|
|
118
|
+
return alreadyTransformedToImage;
|
|
119
|
+
}
|
|
109
120
|
|
|
110
121
|
/**
|
|
111
122
|
* @returns {symbol}
|
|
112
123
|
* @readonly
|
|
113
124
|
*/
|
|
114
|
-
static get obliqueGeometry() {
|
|
125
|
+
static get obliqueGeometry() {
|
|
126
|
+
return obliqueGeometry;
|
|
127
|
+
}
|
|
115
128
|
|
|
116
129
|
/**
|
|
117
130
|
* @returns {symbol}
|
|
118
131
|
* @readonly
|
|
119
132
|
*/
|
|
120
|
-
static get doNotTransform() {
|
|
133
|
+
static get doNotTransform() {
|
|
134
|
+
return doNotTransform;
|
|
135
|
+
}
|
|
121
136
|
|
|
122
137
|
/**
|
|
123
138
|
* @returns {symbol}
|
|
124
139
|
* @readonly
|
|
125
140
|
*/
|
|
126
|
-
static get originalFeatureSymbol() {
|
|
141
|
+
static get originalFeatureSymbol() {
|
|
142
|
+
return originalFeatureSymbol;
|
|
143
|
+
}
|
|
127
144
|
|
|
128
145
|
/**
|
|
129
146
|
* @returns {VectorOptions}
|
|
@@ -150,11 +167,11 @@ class Vector extends FeatureLayer {
|
|
|
150
167
|
|
|
151
168
|
this._supportedMaps = [
|
|
152
169
|
CesiumMap.className,
|
|
153
|
-
|
|
154
|
-
|
|
170
|
+
ObliqueMap.className,
|
|
171
|
+
OpenlayersMap.className,
|
|
155
172
|
];
|
|
156
173
|
|
|
157
|
-
const defaultOptions =
|
|
174
|
+
const defaultOptions = VectorLayer.getDefaultOptions();
|
|
158
175
|
/** @type {import("ol/source").Vector<import("ol/geom/Geometry").default>} */
|
|
159
176
|
this.source = new VectorSource({});
|
|
160
177
|
|
|
@@ -162,21 +179,32 @@ class Vector extends FeatureLayer {
|
|
|
162
179
|
this.projection = new Projection(options.projection);
|
|
163
180
|
|
|
164
181
|
/** @type {?number} */
|
|
165
|
-
this.maxResolution =
|
|
182
|
+
this.maxResolution =
|
|
183
|
+
options.maxResolution != null
|
|
184
|
+
? options.maxResolution
|
|
185
|
+
: defaultOptions.maxResolution;
|
|
166
186
|
|
|
167
187
|
/** @type {?number} */
|
|
168
|
-
this.minResolution =
|
|
188
|
+
this.minResolution =
|
|
189
|
+
options.minResolution != null
|
|
190
|
+
? options.minResolution
|
|
191
|
+
: defaultOptions.minResolution;
|
|
169
192
|
|
|
170
193
|
/** @type {boolean} */
|
|
171
|
-
this.dontUseTerrainForOblique =
|
|
172
|
-
|
|
194
|
+
this.dontUseTerrainForOblique = parseBoolean(
|
|
195
|
+
options.dontUseTerrainForOblique,
|
|
196
|
+
defaultOptions.dontUseTerrainForOblique,
|
|
197
|
+
);
|
|
173
198
|
|
|
174
199
|
/** @type {import("@vcmap/core").VectorStyleItem} */
|
|
175
|
-
this.highlightStyle = /** @type {undefined} */ (
|
|
200
|
+
this.highlightStyle = /** @type {undefined} */ (
|
|
201
|
+
defaultOptions.highlightStyle
|
|
202
|
+
);
|
|
176
203
|
if (options.highlightStyle) {
|
|
177
|
-
this.highlightStyle =
|
|
178
|
-
options.highlightStyle
|
|
179
|
-
|
|
204
|
+
this.highlightStyle =
|
|
205
|
+
options.highlightStyle instanceof VectorStyleItem
|
|
206
|
+
? options.highlightStyle
|
|
207
|
+
: new VectorStyleItem(options.highlightStyle);
|
|
180
208
|
}
|
|
181
209
|
|
|
182
210
|
/**
|
|
@@ -213,17 +241,12 @@ class Vector extends FeatureLayer {
|
|
|
213
241
|
});
|
|
214
242
|
|
|
215
243
|
let initialStyle = options.style;
|
|
216
|
-
if (options.
|
|
217
|
-
initialStyle =
|
|
218
|
-
type: StyleType.REFERENCE,
|
|
219
|
-
name: options.activeStyleName,
|
|
220
|
-
};
|
|
221
|
-
} else if (options.style instanceof StyleItem) {
|
|
222
|
-
initialStyle = options.style.getOptions();
|
|
244
|
+
if (options.style instanceof StyleItem) {
|
|
245
|
+
initialStyle = options.style.toJSON();
|
|
223
246
|
}
|
|
224
247
|
|
|
225
248
|
/**
|
|
226
|
-
* @type {
|
|
249
|
+
* @type {StyleItemOptions}
|
|
227
250
|
* @private
|
|
228
251
|
*/
|
|
229
252
|
this._initialStyle = initialStyle;
|
|
@@ -249,7 +272,9 @@ class Vector extends FeatureLayer {
|
|
|
249
272
|
* @type {boolean}
|
|
250
273
|
* @api
|
|
251
274
|
*/
|
|
252
|
-
get visibility() {
|
|
275
|
+
get visibility() {
|
|
276
|
+
return this._visibility;
|
|
277
|
+
}
|
|
253
278
|
|
|
254
279
|
/**
|
|
255
280
|
* @param {boolean} visible
|
|
@@ -266,10 +291,9 @@ class Vector extends FeatureLayer {
|
|
|
266
291
|
* @returns {Promise<void>}
|
|
267
292
|
*/
|
|
268
293
|
initialize() {
|
|
269
|
-
return super.initialize()
|
|
270
|
-
.
|
|
271
|
-
|
|
272
|
-
});
|
|
294
|
+
return super.initialize().then(() => {
|
|
295
|
+
this._trackStyleChanges();
|
|
296
|
+
});
|
|
273
297
|
}
|
|
274
298
|
|
|
275
299
|
/**
|
|
@@ -294,6 +318,10 @@ class Vector extends FeatureLayer {
|
|
|
294
318
|
// TODO embed icons here by running over all features? this is never used anywhere
|
|
295
319
|
}
|
|
296
320
|
|
|
321
|
+
if (Object.keys(this.properties).length !== 0) {
|
|
322
|
+
vcsMeta.layerProperties = { ...this.properties };
|
|
323
|
+
}
|
|
324
|
+
|
|
297
325
|
return vcsMeta;
|
|
298
326
|
}
|
|
299
327
|
|
|
@@ -301,8 +329,12 @@ class Vector extends FeatureLayer {
|
|
|
301
329
|
* Sets the meta values based on a {@link VcsMeta} Object. Does not carry over the style
|
|
302
330
|
* @param {VcsMeta} vcsMeta
|
|
303
331
|
*/
|
|
304
|
-
setVcsMeta(vcsMeta) {
|
|
332
|
+
setVcsMeta(vcsMeta) {
|
|
333
|
+
// XXX what about the style?
|
|
305
334
|
this.vectorProperties.setVcsMeta(vcsMeta);
|
|
335
|
+
if (vcsMeta.layerProperties) {
|
|
336
|
+
Object.assign(this.properties, vcsMeta.layerProperties);
|
|
337
|
+
}
|
|
306
338
|
}
|
|
307
339
|
|
|
308
340
|
/**
|
|
@@ -321,40 +353,43 @@ class Vector extends FeatureLayer {
|
|
|
321
353
|
/**
|
|
322
354
|
* @inheritDoc
|
|
323
355
|
* @param {import("@vcmap/core").VcsMap} map
|
|
324
|
-
* @returns {Array<
|
|
356
|
+
* @returns {Array<VectorObliqueImpl|VectorCesiumImpl|VectorOpenlayersImpl>}
|
|
325
357
|
*/
|
|
326
358
|
createImplementationsForMap(map) {
|
|
327
359
|
if (!this.visibility) {
|
|
328
360
|
return [];
|
|
329
361
|
}
|
|
330
362
|
|
|
331
|
-
if (map instanceof
|
|
332
|
-
return [new
|
|
363
|
+
if (map instanceof OpenlayersMap) {
|
|
364
|
+
return [new VectorOpenlayersImpl(map, this.getImplementationOptions())];
|
|
333
365
|
}
|
|
334
366
|
|
|
335
367
|
if (map instanceof CesiumMap) {
|
|
336
|
-
return [new
|
|
368
|
+
return [new VectorCesiumImpl(map, this.getImplementationOptions())];
|
|
337
369
|
}
|
|
338
370
|
|
|
339
|
-
if (map instanceof
|
|
340
|
-
return [new
|
|
371
|
+
if (map instanceof ObliqueMap) {
|
|
372
|
+
return [new VectorObliqueImpl(map, this.getImplementationOptions())];
|
|
341
373
|
}
|
|
342
374
|
|
|
343
375
|
return [];
|
|
344
376
|
}
|
|
345
377
|
|
|
346
378
|
/**
|
|
347
|
-
* @param {(
|
|
379
|
+
* @param {(DeclarativeStyleItemOptions|VectorStyleItemOptions|import("@vcmap/core").StyleItem)=} styleOptions
|
|
348
380
|
* @param {import("@vcmap/core").VectorStyleItem=} defaultStyle
|
|
349
381
|
* @returns {import("@vcmap/core").StyleItem}
|
|
350
382
|
*/
|
|
351
383
|
getStyleOrDefaultStyle(styleOptions, defaultStyle) {
|
|
352
|
-
return super.getStyleOrDefaultStyle(
|
|
384
|
+
return super.getStyleOrDefaultStyle(
|
|
385
|
+
styleOptions,
|
|
386
|
+
defaultStyle || defaultVectorStyle.clone(),
|
|
387
|
+
);
|
|
353
388
|
}
|
|
354
389
|
|
|
355
390
|
/**
|
|
356
391
|
* sets the style of this layer
|
|
357
|
-
* @param {import("ol/style/Style").default|import("ol/style/Style").StyleFunction|import("@vcmap/core").StyleItem
|
|
392
|
+
* @param {import("ol/style/Style").default|import("ol/style/Style").StyleFunction|import("@vcmap/core").StyleItem} style
|
|
358
393
|
* @param {boolean=} silent
|
|
359
394
|
*/
|
|
360
395
|
setStyle(style, silent) {
|
|
@@ -390,13 +425,15 @@ class Vector extends FeatureLayer {
|
|
|
390
425
|
}
|
|
391
426
|
|
|
392
427
|
const isDeclarative = this.style instanceof DeclarativeStyleItem;
|
|
393
|
-
this._onStyleChangeRemover = this.style.styleChanged.addEventListener(
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
f
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
428
|
+
this._onStyleChangeRemover = this.style.styleChanged.addEventListener(
|
|
429
|
+
() => {
|
|
430
|
+
this.getFeatures().forEach((f) => {
|
|
431
|
+
if (isDeclarative || !f[vectorStyleSymbol]) {
|
|
432
|
+
f.changed();
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
},
|
|
436
|
+
);
|
|
400
437
|
}
|
|
401
438
|
|
|
402
439
|
/**
|
|
@@ -453,9 +490,9 @@ class Vector extends FeatureLayer {
|
|
|
453
490
|
if (this.projection.epsg !== mercatorProjection.epsg) {
|
|
454
491
|
const geometry = feature.getGeometry();
|
|
455
492
|
if (geometry) {
|
|
456
|
-
if (!geometry[
|
|
493
|
+
if (!geometry[VectorLayer.alreadyTransformedToMercator]) {
|
|
457
494
|
geometry.transform(this.projection.proj, mercatorProjection.proj);
|
|
458
|
-
geometry[
|
|
495
|
+
geometry[VectorLayer.alreadyTransformedToMercator] = true;
|
|
459
496
|
}
|
|
460
497
|
}
|
|
461
498
|
}
|
|
@@ -467,9 +504,13 @@ class Vector extends FeatureLayer {
|
|
|
467
504
|
|
|
468
505
|
return feature;
|
|
469
506
|
})
|
|
470
|
-
.filter(f => f);
|
|
471
|
-
this.source.addFeatures(
|
|
472
|
-
|
|
507
|
+
.filter((f) => f);
|
|
508
|
+
this.source.addFeatures(
|
|
509
|
+
/** @type {Array<import("ol").Feature<import("ol/geom/Geometry").default>>} */ (
|
|
510
|
+
toAdd
|
|
511
|
+
),
|
|
512
|
+
);
|
|
513
|
+
return features.map((f) => f.getId());
|
|
473
514
|
}
|
|
474
515
|
|
|
475
516
|
/**
|
|
@@ -501,8 +542,7 @@ class Vector extends FeatureLayer {
|
|
|
501
542
|
*/
|
|
502
543
|
getFeaturesById(ids) {
|
|
503
544
|
check(ids, [[String, Number]]);
|
|
504
|
-
return ids.map(id => this.getFeatureById(id))
|
|
505
|
-
.filter(f => f != null);
|
|
545
|
+
return ids.map((id) => this.getFeatureById(id)).filter((f) => f != null);
|
|
506
546
|
}
|
|
507
547
|
|
|
508
548
|
/**
|
|
@@ -538,7 +578,7 @@ class Vector extends FeatureLayer {
|
|
|
538
578
|
return metaExtent;
|
|
539
579
|
}
|
|
540
580
|
const extent = new Extent({
|
|
541
|
-
|
|
581
|
+
projection: mercatorProjection.toJSON(),
|
|
542
582
|
coordinates: this.source.getExtent(),
|
|
543
583
|
});
|
|
544
584
|
if (extent.isValid()) {
|
|
@@ -562,20 +602,12 @@ class Vector extends FeatureLayer {
|
|
|
562
602
|
return null;
|
|
563
603
|
}
|
|
564
604
|
|
|
565
|
-
/**
|
|
566
|
-
* @param {VectorClickedObject} object
|
|
567
|
-
* @returns {?GenericFeature}
|
|
568
|
-
*/
|
|
569
|
-
getGenericFeatureFromClickedObject(object) {
|
|
570
|
-
return getGenericFeatureFromClickedObject(object, this);
|
|
571
|
-
}
|
|
572
|
-
|
|
573
605
|
/**
|
|
574
606
|
* @returns {VectorOptions}
|
|
575
607
|
*/
|
|
576
608
|
toJSON() {
|
|
577
609
|
const config = /** @type {VectorOptions} */ (super.toJSON());
|
|
578
|
-
const defaultOptions =
|
|
610
|
+
const defaultOptions = VectorLayer.getDefaultOptions();
|
|
579
611
|
|
|
580
612
|
if (this.projection.epsg !== getDefaultProjection().epsg) {
|
|
581
613
|
config.projection = this.projection.toJSON();
|
|
@@ -589,14 +621,14 @@ class Vector extends FeatureLayer {
|
|
|
589
621
|
config.minResolution = this.minResolution;
|
|
590
622
|
}
|
|
591
623
|
|
|
592
|
-
if (
|
|
624
|
+
if (
|
|
625
|
+
this.dontUseTerrainForOblique !== defaultOptions.dontUseTerrainForOblique
|
|
626
|
+
) {
|
|
593
627
|
config.dontUseTerrainForOblique = this.dontUseTerrainForOblique;
|
|
594
628
|
}
|
|
595
629
|
|
|
596
630
|
if (this.highlightStyle) {
|
|
597
|
-
config.highlightStyle = this.highlightStyle
|
|
598
|
-
this.highlightStyle.getReference() :
|
|
599
|
-
this.highlightStyle.getOptions();
|
|
631
|
+
config.highlightStyle = this.highlightStyle.toJSON();
|
|
600
632
|
}
|
|
601
633
|
|
|
602
634
|
if (this.isDynamic !== defaultOptions.isDynamic) {
|
|
@@ -608,8 +640,6 @@ class Vector extends FeatureLayer {
|
|
|
608
640
|
config.vectorProperties = vectorPropertiesConfig;
|
|
609
641
|
}
|
|
610
642
|
|
|
611
|
-
// XXX missing style
|
|
612
|
-
|
|
613
643
|
return config;
|
|
614
644
|
}
|
|
615
645
|
|
|
@@ -628,5 +658,5 @@ class Vector extends FeatureLayer {
|
|
|
628
658
|
}
|
|
629
659
|
}
|
|
630
660
|
|
|
631
|
-
|
|
632
|
-
export default
|
|
661
|
+
layerClassRegistry.registerClass(VectorLayer.className, VectorLayer);
|
|
662
|
+
export default VectorLayer;
|