@vcmap/core 5.0.0-rc.2 → 5.0.0-rc.20
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 +3 -2
- package/index.d.ts +2221 -1992
- package/index.js +137 -131
- package/package.json +16 -23
- package/src/category/appBackedCategory.js +89 -0
- package/src/category/category.js +444 -0
- package/src/category/categoryCollection.js +145 -0
- package/src/cesium/cesium3DTileFeature.js +1 -1
- package/src/cesium/entity.js +27 -0
- package/src/classRegistry.js +162 -0
- package/src/context.js +89 -0
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/abstractFeatureProvider.js +6 -7
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/featureProviderHelpers.js +4 -5
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/featureProviderSymbols.js +0 -0
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/tileProviderFeatureProvider.js +4 -2
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/wmsFeatureProvider.js +22 -14
- package/src/{vcs/vcm/interaction → interaction}/abstractInteraction.js +20 -19
- package/src/{vcs/vcm/interaction → interaction}/coordinateAtPixel.js +7 -10
- package/src/{vcs/vcm/interaction → interaction}/eventHandler.js +3 -3
- package/src/{vcs/vcm/interaction → interaction}/featureAtPixelInteraction.js +17 -26
- package/src/{vcs/vcm/interaction → interaction}/featureProviderInteraction.js +3 -14
- package/src/{vcs/vcm/interaction → interaction}/interactionChain.js +11 -32
- package/src/{vcs/vcm/interaction → interaction}/interactionType.js +1 -5
- package/src/{vcs/vcm/layer/cesium/cesiumTilesetCesium.js → layer/cesium/cesiumTilesetCesiumImpl.js} +10 -13
- package/src/{vcs/vcm/layer → layer}/cesium/clusterContext.js +0 -0
- package/src/{vcs/vcm/layer/cesium/dataSourceCesium.js → layer/cesium/dataSourceCesiumImpl.js} +5 -3
- package/src/{vcs/vcm/layer/cesium/openStreetMapCesium.js → layer/cesium/openStreetMapCesiumImpl.js} +6 -7
- package/src/{vcs/vcm/layer/cesium/rasterLayerCesium.js → layer/cesium/rasterLayerCesiumImpl.js} +5 -6
- package/src/{vcs/vcm/layer/cesium/singleImageCesium.js → layer/cesium/singleImageCesiumImpl.js} +5 -6
- package/src/{vcs/vcm/layer/cesium/terrainCesium.js → layer/cesium/terrainCesiumImpl.js} +4 -5
- package/src/{vcs/vcm/layer/cesium/tmsCesium.js → layer/cesium/tmsCesiumImpl.js} +6 -7
- package/src/{vcs/vcm/layer/cesium/vectorCesium.js → layer/cesium/vectorCesiumImpl.js} +6 -7
- package/src/{vcs/vcm/layer → layer}/cesium/vectorContext.js +0 -0
- package/src/{vcs/vcm/layer/cesium/vectorRasterTileCesium.js → layer/cesium/vectorRasterTileCesiumImpl.js} +5 -6
- package/src/{vcs/vcm/layer → layer}/cesium/vectorTileImageryProvider.js +1 -2
- package/src/{vcs/vcm/layer/cesium/wmsCesium.js → layer/cesium/wmsCesiumImpl.js} +6 -7
- package/src/{vcs/vcm/layer/cesium/wmtsCesium.js → layer/cesium/wmtsCesiumImpl.js} +6 -7
- package/src/{vcs/vcm/layer → layer}/cesium/x3dmHelper.js +0 -0
- package/src/{vcs/vcm/layer/cesiumTileset.js → layer/cesiumTilesetLayer.js} +36 -35
- package/src/{vcs/vcm/layer/czml.js → layer/czmlLayer.js} +12 -15
- package/src/{vcs/vcm/layer/dataSource.js → layer/dataSourceLayer.js} +36 -27
- package/src/{vcs/vcm/layer → layer}/featureLayer.js +25 -29
- package/src/{vcs/vcm/layer/featureStore.js → layer/featureStoreLayer.js} +51 -51
- package/src/{vcs/vcm/layer/featureStoreChanges.js → layer/featureStoreLayerChanges.js} +100 -82
- package/src/{vcs/vcm/layer/featureStoreState.js → layer/featureStoreLayerState.js} +1 -2
- package/src/{vcs/vcm/layer → layer}/featureVisibility.js +9 -6
- package/src/{vcs/vcm/layer → layer}/geojsonHelpers.js +15 -41
- package/src/{vcs/vcm/layer/geojson.js → layer/geojsonLayer.js} +15 -18
- package/src/{vcs/vcm/layer → layer}/globalHider.js +8 -32
- package/src/{vcs/vcm/layer → layer}/layer.js +92 -46
- package/src/{vcs/vcm/layer → layer}/layerImplementation.js +2 -3
- package/src/{vcs/vcm/layer → layer}/layerState.js +0 -1
- package/src/{vcs/vcm/layer → layer}/layerSymbols.js +0 -0
- package/src/{vcs/vcm/layer/oblique/layerOblique.js → layer/oblique/layerObliqueImpl.js} +4 -4
- package/src/{vcs/vcm/layer → layer}/oblique/obliqueHelpers.js +2 -2
- package/src/{vcs/vcm/layer/oblique/vectorOblique.js → layer/oblique/vectorObliqueImpl.js} +7 -9
- package/src/{vcs/vcm/layer/openStreetMap.js → layer/openStreetMapLayer.js} +30 -31
- package/src/{vcs/vcm/layer/openlayers/layerOpenlayers.js → layer/openlayers/layerOpenlayersImpl.js} +5 -6
- package/src/layer/openlayers/openStreetMapOpenlayersImpl.js +26 -0
- package/src/{vcs/vcm/layer/openlayers/rasterLayerOpenlayers.js → layer/openlayers/rasterLayerOpenlayersImpl.js} +15 -14
- package/src/{vcs/vcm/layer/openlayers/singleImageOpenlayers.js → layer/openlayers/singleImageOpenlayersImpl.js} +6 -7
- package/src/{vcs/vcm/layer/openlayers/tileDebugOpenlayers.js → layer/openlayers/tileDebugOpenlayersImpl.js} +5 -6
- package/src/{vcs/vcm/layer/openlayers/tmsOpenlayers.js → layer/openlayers/tmsOpenlayersImpl.js} +7 -8
- package/src/{vcs/vcm/layer/openlayers/vectorOpenlayers.js → layer/openlayers/vectorOpenlayersImpl.js} +8 -9
- package/src/{vcs/vcm/layer/openlayers/vectorTileOpenlayers.js → layer/openlayers/vectorTileOpenlayersImpl.js} +6 -7
- package/src/{vcs/vcm/layer/openlayers/wmsOpenlayers.js → layer/openlayers/wmsOpenlayersImpl.js} +7 -8
- package/src/{vcs/vcm/layer/openlayers/wmtsOpenlayers.js → layer/openlayers/wmtsOpenlayersImpl.js} +7 -8
- package/src/{vcs/vcm/layer/pointCloud.js → layer/pointCloudLayer.js} +24 -32
- package/src/{vcs/vcm/layer → layer}/rasterLayer.js +16 -18
- package/src/{vcs/vcm/layer/singleImage.js → layer/singleImageLayer.js} +18 -18
- package/src/{vcs/vcm/layer → layer}/terrainHelpers.js +13 -49
- package/src/{vcs/vcm/layer/terrain.js → layer/terrainLayer.js} +11 -12
- package/src/{vcs/vcm/layer → layer}/tileLoadedHelper.js +5 -5
- package/src/{vcs/vcm/layer → layer}/tileProvider/mvtTileProvider.js +43 -6
- package/src/layer/tileProvider/staticGeojsonTileProvider.js +81 -0
- package/src/{vcs/vcm/layer → layer}/tileProvider/tileProvider.js +41 -6
- package/src/{vcs/vcm/layer → layer}/tileProvider/urlTemplateTileProvider.js +46 -11
- package/src/{vcs/vcm/layer/tms.js → layer/tmsLayer.js} +17 -18
- package/src/{vcs/vcm/layer → layer}/vectorHelpers.js +5 -5
- package/src/{vcs/vcm/layer/vector.js → layer/vectorLayer.js} +35 -45
- package/src/{vcs/vcm/layer → layer}/vectorProperties.js +3 -4
- package/src/{vcs/vcm/layer → layer}/vectorSymbols.js +0 -0
- package/src/{vcs/vcm/layer/vectorTile.js → layer/vectorTileLayer.js} +75 -52
- package/src/{vcs/vcm/layer/wfs.js → layer/wfsLayer.js} +16 -17
- package/src/{vcs/vcm/layer → layer}/wmsHelpers.js +1 -1
- package/src/{vcs/vcm/layer/wms.js → layer/wmsLayer.js} +19 -20
- package/src/{vcs/vcm/layer/wmts.js → layer/wmtsLayer.js} +24 -25
- package/src/{vcs/vcm/maps → map}/baseOLMap.js +5 -6
- package/src/{vcs/vcm/maps → map}/cameraLimiter.js +10 -16
- package/src/{vcs/vcm/maps/cesium.js → map/cesiumMap.js} +18 -31
- package/src/{vcs/vcm/maps → map}/mapState.js +0 -1
- package/src/{vcs/vcm/maps/oblique.js → map/obliqueMap.js} +40 -55
- package/src/{vcs/vcm/maps/openlayers.js → map/openlayersMap.js} +15 -13
- package/src/{vcs/vcm/maps/map.js → map/vcsMap.js} +39 -20
- package/src/oblique/defaultObliqueCollection.js +62 -0
- package/src/{vcs/vcm/oblique → oblique}/helpers.js +13 -44
- package/src/{vcs/vcm/oblique/ObliqueCollection.js → oblique/obliqueCollection.js} +117 -37
- package/src/{vcs/vcm/oblique/ObliqueDataSet.js → oblique/obliqueDataSet.js} +67 -26
- package/src/{vcs/vcm/oblique/ObliqueImage.js → oblique/obliqueImage.js} +1 -2
- package/src/{vcs/vcm/oblique/ObliqueImageMeta.js → oblique/obliqueImageMeta.js} +4 -5
- package/src/{vcs/vcm/oblique/ObliqueProvider.js → oblique/obliqueProvider.js} +17 -12
- package/src/{vcs/vcm/oblique/ObliqueView.js → oblique/obliqueView.js} +31 -2
- package/src/{vcs/vcm/oblique/ObliqueViewDirection.js → oblique/obliqueViewDirection.js} +0 -3
- package/src/{vcs/vcm/oblique → oblique}/parseImageJson.js +20 -12
- package/src/ol/geom/circle.js +1 -1
- package/src/ol/render/canvas/canvasTileRenderer.js +0 -1
- package/src/overrideClassRegistry.js +204 -0
- package/src/{vcs/vcm/util/style → style}/declarativeStyleItem.js +43 -20
- package/src/{vcs/vcm/util/style → style}/shapesCategory.js +0 -2
- package/src/style/styleFactory.js +29 -0
- package/src/{vcs/vcm/util/style → style}/styleHelpers.js +3 -14
- package/src/{vcs/vcm/util/style → style}/styleItem.js +18 -105
- package/src/{vcs/vcm/util/style → style}/vectorStyleItem.js +73 -85
- package/src/{vcs/vcm/util/style → style}/writeStyle.js +4 -7
- package/src/{vcs/vcm/util → util}/clipping/clippingObject.js +10 -12
- package/src/{vcs/vcm/util → util}/clipping/clippingObjectManager.js +2 -3
- package/src/{vcs/vcm/util → util}/clipping/clippingPlaneHelper.js +4 -8
- package/src/{vcs/vcm/util → util}/collection.js +16 -4
- package/src/{vcs/vcm/util → util}/exclusiveManager.js +0 -0
- package/src/{vcs/vcm/util → util}/extent.js +16 -10
- package/src/{vcs/vcm/util → util}/featureconverter/circleToCesium.js +0 -0
- package/src/{vcs/vcm/util → util}/featureconverter/convert.js +0 -0
- package/src/util/featureconverter/extent3D.js +181 -0
- package/src/{vcs/vcm/util → util}/featureconverter/featureconverterHelper.js +1 -1
- package/src/{vcs/vcm/util → util}/featureconverter/lineStringToCesium.js +0 -0
- package/src/{vcs/vcm/util → util}/featureconverter/pointToCesium.js +9 -6
- package/src/{vcs/vcm/util → util}/featureconverter/polygonToCesium.js +1 -1
- package/src/util/fetch.js +32 -0
- package/src/{vcs/vcm/util → util}/geometryHelpers.js +0 -0
- package/src/{vcs/vcm/util → util}/indexedCollection.js +24 -2
- package/src/{vcs/vcm/util → util}/isMobile.js +0 -0
- package/src/{vcs/vcm/util → util}/layerCollection.js +89 -12
- package/src/util/locale.js +12 -0
- package/src/{vcs/vcm/util → util}/mapCollection.js +91 -34
- package/src/{vcs/vcm/util → util}/math.js +0 -0
- package/src/util/overrideCollection.js +223 -0
- package/src/{vcs/vcm/util → util}/projection.js +38 -28
- package/src/{vcs/vcm/util → util}/splitScreen.js +10 -10
- package/src/{vcs/vcm/util → util}/urlHelpers.js +0 -0
- package/src/{vcs/vcm/util → util}/viewpoint.js +2 -6
- package/src/vcsApp.js +571 -0
- package/src/vcsAppContextHelpers.js +121 -0
- package/src/{vcs/vcm/event/vcsEvent.js → vcsEvent.js} +2 -3
- package/src/{vcs/vcm/object.js → vcsObject.js} +1 -9
- 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 +290 -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/vcs/vcm/classRegistry.js +0 -106
- package/src/vcs/vcm/globalCollections.js +0 -11
- package/src/vcs/vcm/layer/buildings.js +0 -17
- package/src/vcs/vcm/layer/cesium/pointCloudCesium.js +0 -58
- package/src/vcs/vcm/layer/openlayers/openStreetMapOpenlayers.js +0 -27
- package/src/vcs/vcm/layer/tileProvider/staticGeojsonTileProvider.js +0 -67
- package/src/vcs/vcm/layer/tileProvider/tileProviderFactory.js +0 -28
- package/src/vcs/vcm/util/dateTime.js +0 -60
- package/src/vcs/vcm/util/featureconverter/extent3d.js +0 -154
- package/src/vcs/vcm/util/locale.js +0 -53
- package/src/vcs/vcm/util/style/styleFactory.js +0 -48
|
@@ -6,18 +6,15 @@ import Point from 'ol/geom/Point.js';
|
|
|
6
6
|
import Circle from 'ol/geom/Circle.js';
|
|
7
7
|
|
|
8
8
|
import { getDistance as haversineDistance } from 'ol/sphere.js';
|
|
9
|
-
import { getLogger as getLoggerByName } from '@vcsuite/logger';
|
|
10
9
|
import Projection, { mercatorProjection, wgs84Projection } from '../util/projection.js';
|
|
11
|
-
import VectorStyleItem, { defaultVectorStyle, vectorStyleSymbol } from '../
|
|
12
|
-
import { parseColor } from '../
|
|
13
|
-
import
|
|
14
|
-
import { featureStoreStateSymbol } from './
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import DeclarativeStyleItem from '../util/style/declarativeStyleItem.js';
|
|
10
|
+
import VectorStyleItem, { defaultVectorStyle, vectorStyleSymbol } from '../style/vectorStyleItem.js';
|
|
11
|
+
import { parseColor } from '../style/styleHelpers.js';
|
|
12
|
+
import VectorLayer from './vectorLayer.js';
|
|
13
|
+
import { featureStoreStateSymbol } from './featureStoreLayerState.js';
|
|
14
|
+
import { embedIconsInStyle } from '../style/writeStyle.js';
|
|
15
|
+
import DeclarativeStyleItem from '../style/declarativeStyleItem.js';
|
|
18
16
|
import { vcsMetaVersion } from './layer.js';
|
|
19
|
-
import
|
|
20
|
-
import { styleCollection } from '../globalCollections.js';
|
|
17
|
+
import Extent3D from '../util/featureconverter/extent3D.js';
|
|
21
18
|
import { circleFromCenterRadius, enforceEndingVertex, removeEndingVertexFromGeometry } from '../util/geometryHelpers.js';
|
|
22
19
|
|
|
23
20
|
const featureProjection = 'EPSG:3857';
|
|
@@ -38,13 +35,6 @@ function getFormat() {
|
|
|
38
35
|
return format;
|
|
39
36
|
}
|
|
40
37
|
|
|
41
|
-
/**
|
|
42
|
-
* @returns {import("@vcsuite/logger").Logger}
|
|
43
|
-
*/
|
|
44
|
-
function getLogger() {
|
|
45
|
-
return getLoggerByName('vcs.vcm.layer.GeoJSONHelper');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
38
|
/**
|
|
49
39
|
* @typedef {Object} GeoJSONData
|
|
50
40
|
* @property {Array<import("ol").Feature<import("ol/geom/Geometry").default>>} features
|
|
@@ -84,7 +74,6 @@ function getLogger() {
|
|
|
84
74
|
/**
|
|
85
75
|
* @param {Object} geojson
|
|
86
76
|
* @returns {string|null}
|
|
87
|
-
* @export
|
|
88
77
|
*/
|
|
89
78
|
export function getEPSGCodeFromGeojson(geojson) {
|
|
90
79
|
const { crs } = geojson;
|
|
@@ -92,7 +81,7 @@ export function getEPSGCodeFromGeojson(geojson) {
|
|
|
92
81
|
if (crs.type === 'name') {
|
|
93
82
|
return crs.properties.name;
|
|
94
83
|
} else if (crs.type === 'EPSG') {
|
|
95
|
-
// 'EPSG' is not part of the
|
|
84
|
+
// 'EPSG' is not part of the GeojsonLayer specification, but is generated by
|
|
96
85
|
// GeoServer.
|
|
97
86
|
// TODO: remove this when http://jira.codehaus.org/browse/GEOS-5996
|
|
98
87
|
// is fixed and widely deployed.
|
|
@@ -105,7 +94,6 @@ export function getEPSGCodeFromGeojson(geojson) {
|
|
|
105
94
|
/**
|
|
106
95
|
* updates legacy features to the new olcesium namespaceing olcs_
|
|
107
96
|
* @param {import("ol").Feature<import("ol/geom/Geometry").default>} feature
|
|
108
|
-
* @export
|
|
109
97
|
*/
|
|
110
98
|
export function updateLegacyFeature(feature) {
|
|
111
99
|
// these changes can be done silently, because the features haven't been added to any layer
|
|
@@ -117,8 +105,8 @@ export function updateLegacyFeature(feature) {
|
|
|
117
105
|
if (feature.get('drawingType')) {
|
|
118
106
|
feature.set('olcs_extrudedHeight', feature.get('extrudedHeight'), true);
|
|
119
107
|
} else {
|
|
120
|
-
const extent =
|
|
121
|
-
const minHeight = Number.isFinite(extent
|
|
108
|
+
const extent = Extent3D.fromGeometry(feature.getGeometry());
|
|
109
|
+
const minHeight = Number.isFinite(extent.minZ) ? extent.minZ : 0;
|
|
122
110
|
feature.set('olcs_extrudedHeight', feature.get('extrudedHeight') - minHeight, true);
|
|
123
111
|
}
|
|
124
112
|
feature.unset('extrudedHeight', true);
|
|
@@ -141,7 +129,7 @@ export function updateLegacyFeature(feature) {
|
|
|
141
129
|
function readGeometry(geometryObj, options) {
|
|
142
130
|
const geometry = getFormat().readGeometry(geometryObj, options.formatOptions);
|
|
143
131
|
if (String(options.formatOptions.featureProjection) === 'EPSG:3857') {
|
|
144
|
-
geometry[
|
|
132
|
+
geometry[VectorLayer.alreadyTransformedToMercator] = true;
|
|
145
133
|
}
|
|
146
134
|
removeEndingVertexFromGeometry(geometry);
|
|
147
135
|
return new Feature({ geometry });
|
|
@@ -246,7 +234,7 @@ function readFeature(featureObj, options) {
|
|
|
246
234
|
geometry = circleFromCenterRadius(coordinates, radius);
|
|
247
235
|
}
|
|
248
236
|
if (String(options.formatOptions.featureProjection) === 'EPSG:3857') {
|
|
249
|
-
geometry[
|
|
237
|
+
geometry[VectorLayer.alreadyTransformedToMercator] = true;
|
|
250
238
|
}
|
|
251
239
|
|
|
252
240
|
featureObj.vcsMeta = featureObj.vcsMeta || {};
|
|
@@ -288,12 +276,11 @@ function readFeature(featureObj, options) {
|
|
|
288
276
|
}
|
|
289
277
|
|
|
290
278
|
/**
|
|
291
|
-
* parses a string to
|
|
279
|
+
* parses a string to GeojsonLayer
|
|
292
280
|
* @param {string|Object} input
|
|
293
281
|
* @param {GeoJSONreadOptions=} readOptions
|
|
294
282
|
* @returns {GeoJSONData}
|
|
295
283
|
* @throws SyntaxError
|
|
296
|
-
* @export
|
|
297
284
|
* @api
|
|
298
285
|
*/
|
|
299
286
|
export function parseGeoJSON(input, readOptions = {}) {
|
|
@@ -331,14 +318,7 @@ export function parseGeoJSON(input, readOptions = {}) {
|
|
|
331
318
|
options.embeddedIcons = geoJSON.vcsMeta.embeddedIcons;
|
|
332
319
|
}
|
|
333
320
|
if (geoJSON.vcsMeta.style && readOptions.dynamicStyle) {
|
|
334
|
-
if (geoJSON.vcsMeta.style.type ===
|
|
335
|
-
style = styleCollection.getByKey(geoJSON.vcsMeta.style.name);
|
|
336
|
-
if (!style) {
|
|
337
|
-
getLogger().warning(`could not load referenced style ${geoJSON.vcsMeta.style.name}`);
|
|
338
|
-
} else if (style instanceof VectorStyleItem) {
|
|
339
|
-
options.defaultStyle = style;
|
|
340
|
-
}
|
|
341
|
-
} else if (geoJSON.vcsMeta.style.type === StyleType.DECLARATIVE) {
|
|
321
|
+
if (geoJSON.vcsMeta.style.type === DeclarativeStyleItem.className) {
|
|
342
322
|
style = new DeclarativeStyleItem(geoJSON.vcsMeta.style);
|
|
343
323
|
} else {
|
|
344
324
|
geoJSON.vcsMeta.style = setEmbeddedIcons(geoJSON.vcsMeta.style, options);
|
|
@@ -425,11 +405,10 @@ export function writeGeoJSONFeature(feature, options = {}, embeddedIcons) {
|
|
|
425
405
|
}
|
|
426
406
|
|
|
427
407
|
/**
|
|
428
|
-
* Writes all the features of the current layer to
|
|
408
|
+
* Writes all the features of the current layer to GeojsonLayer
|
|
429
409
|
* @param {GeoJSONData} data
|
|
430
410
|
* @param {GeoJSONwriteOptions=} options
|
|
431
411
|
* @returns {string|Object}
|
|
432
|
-
* @export
|
|
433
412
|
*/
|
|
434
413
|
export function writeGeoJSON(data, options = {}) { // how to handel embedded icons when they are not set on the vcsMeta but options is true?
|
|
435
414
|
const vcsMeta = data.vcsMeta || {};
|
|
@@ -441,10 +420,5 @@ export function writeGeoJSON(data, options = {}) { // how to handel embedded ico
|
|
|
441
420
|
vcsMeta,
|
|
442
421
|
};
|
|
443
422
|
|
|
444
|
-
if (options.writeStyle && data.style) { // legacy fallback for plugin use
|
|
445
|
-
getLogger().deprecate('data.style', 'use layer.getVcsMeta and pass that in instead');
|
|
446
|
-
writeStyle(data.style, obj.vcsMeta);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
423
|
return options.asObject ? obj : JSON.stringify(obj, null, options.prettyPrint ? 2 : null);
|
|
450
424
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Vector from './vector.js';
|
|
1
|
+
import VectorLayer from './vectorLayer.js';
|
|
3
2
|
import { parseGeoJSON, writeGeoJSONFeature } from './geojsonHelpers.js';
|
|
4
3
|
import Projection, { wgs84Projection } from '../util/projection.js';
|
|
5
|
-
import {
|
|
4
|
+
import { layerClassRegistry } from '../classRegistry.js';
|
|
5
|
+
import { requestJson } from '../util/fetch.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @typedef {VectorOptions} GeoJSONOptions
|
|
9
|
-
* @property {Array<Object>|undefined} features - an array of
|
|
9
|
+
* @property {Array<Object>|undefined} features - an array of GeojsonLayer features to parse
|
|
10
10
|
* @api
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -18,21 +18,20 @@ export const featureFromOptions = Symbol('featureFromOptions');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* GeojsonLayer layer for Cesium, OpenlayersMap and ObliqueMap
|
|
22
22
|
* @class
|
|
23
|
-
* @
|
|
24
|
-
* @extends {Vector}
|
|
23
|
+
* @extends {VectorLayer}
|
|
25
24
|
* @api stable
|
|
26
25
|
*/
|
|
27
|
-
class
|
|
28
|
-
static get className() { return '
|
|
26
|
+
class GeoJSONLayer extends VectorLayer {
|
|
27
|
+
static get className() { return 'GeoJSONLayer'; }
|
|
29
28
|
|
|
30
29
|
/**
|
|
31
30
|
* @returns {GeoJSONOptions}
|
|
32
31
|
*/
|
|
33
32
|
static getDefaultOptions() {
|
|
34
33
|
return {
|
|
35
|
-
...
|
|
34
|
+
...VectorLayer.getDefaultOptions(),
|
|
36
35
|
projection: wgs84Projection.toJSON(),
|
|
37
36
|
features: undefined,
|
|
38
37
|
};
|
|
@@ -42,7 +41,7 @@ class GeoJSON extends Vector {
|
|
|
42
41
|
* @param {GeoJSONOptions} options
|
|
43
42
|
*/
|
|
44
43
|
constructor(options) {
|
|
45
|
-
const defaultOptions =
|
|
44
|
+
const defaultOptions = GeoJSONLayer.getDefaultOptions();
|
|
46
45
|
options.projection = options.projection || defaultOptions.projection;
|
|
47
46
|
|
|
48
47
|
super(options);
|
|
@@ -111,10 +110,8 @@ class GeoJSON extends Vector {
|
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
if (this.url) {
|
|
114
|
-
this._dataFetchedPromise =
|
|
115
|
-
.then(
|
|
116
|
-
this._parseGeojsonData(response.data);
|
|
117
|
-
})
|
|
113
|
+
this._dataFetchedPromise = requestJson(this.url)
|
|
114
|
+
.then(data => this._parseGeojsonData(data))
|
|
118
115
|
.catch((err) => {
|
|
119
116
|
this.getLogger().warning(`Could not send request for loading layer content (${err.message})`);
|
|
120
117
|
return Promise.reject(err);
|
|
@@ -151,7 +148,7 @@ class GeoJSON extends Vector {
|
|
|
151
148
|
*/
|
|
152
149
|
toJSON() {
|
|
153
150
|
const config = /** @type {GeoJSONOptions} */ (super.toJSON());
|
|
154
|
-
const defaultOptions =
|
|
151
|
+
const defaultOptions = GeoJSONLayer.getDefaultOptions();
|
|
155
152
|
|
|
156
153
|
const defaultProjection = new Projection(defaultOptions.projection);
|
|
157
154
|
if (!this.projection.equals(defaultProjection)) {
|
|
@@ -181,5 +178,5 @@ class GeoJSON extends Vector {
|
|
|
181
178
|
}
|
|
182
179
|
}
|
|
183
180
|
|
|
184
|
-
|
|
185
|
-
export default
|
|
181
|
+
layerClassRegistry.registerClass(GeoJSONLayer.className, GeoJSONLayer);
|
|
182
|
+
export default GeoJSONLayer;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { check } from '@vcsuite/check';
|
|
2
|
-
import { getLogger } from '@vcsuite/logger';
|
|
3
2
|
import {
|
|
4
3
|
globalHidden,
|
|
5
4
|
hideFeature,
|
|
@@ -7,14 +6,19 @@ import {
|
|
|
7
6
|
showFeature,
|
|
8
7
|
FeatureVisibilityAction,
|
|
9
8
|
} from './featureVisibility.js';
|
|
10
|
-
import VcsEvent from '../
|
|
9
|
+
import VcsEvent from '../vcsEvent.js';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
|
-
* @
|
|
12
|
+
* @typedef {Object} HiddenObject
|
|
13
|
+
* @property {string} id
|
|
14
14
|
*/
|
|
15
|
-
let instance;
|
|
16
15
|
|
|
17
16
|
/**
|
|
17
|
+
* GlobalHider globally hides features existing within a layer of a {@link LayerCollection}.
|
|
18
|
+
* Features can be defined as hidden by {@link VcsAppConfig} or {@link LayerOptions}.
|
|
19
|
+
* Hiding will be performed, when a {@link Context} is loaded, a {@link Layer} is activated or GlobalHider API is called.
|
|
20
|
+
* A feature can be hidden multiple times by different actors, e.g. contexts, layers, which is handled by this class.
|
|
21
|
+
* A feature will be shown again, when a {@link Context} is removed, a {@link Layer} is deactivated or GlobalHider API is called.
|
|
18
22
|
* @class
|
|
19
23
|
*/
|
|
20
24
|
class GlobalHider {
|
|
@@ -124,34 +128,6 @@ class GlobalHider {
|
|
|
124
128
|
this._hiddenObjectFeatures = {};
|
|
125
129
|
this.changed.destroy();
|
|
126
130
|
}
|
|
127
|
-
|
|
128
|
-
static destroy() {
|
|
129
|
-
if (instance) {
|
|
130
|
-
instance.destroy();
|
|
131
|
-
}
|
|
132
|
-
instance = undefined;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* @returns {GlobalHider}
|
|
138
|
-
* @export
|
|
139
|
-
* @api
|
|
140
|
-
*/
|
|
141
|
-
export function getGlobalHider() {
|
|
142
|
-
if (!instance) {
|
|
143
|
-
instance = new GlobalHider();
|
|
144
|
-
}
|
|
145
|
-
return instance;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* @returns {GlobalHider}
|
|
150
|
-
* @deprecated v4.1
|
|
151
|
-
*/
|
|
152
|
-
export function getInstance() {
|
|
153
|
-
getLogger('vcs.vcm.layer.GlobalHider').deprecate('getInstance', 'use getGlobalHider instead');
|
|
154
|
-
return getGlobalHider();
|
|
155
131
|
}
|
|
156
132
|
|
|
157
133
|
export default GlobalHider;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { check } from '@vcsuite/check';
|
|
1
|
+
import { check, checkMaybe } from '@vcsuite/check';
|
|
2
2
|
import { parseBoolean, parseInteger } from '@vcsuite/parsers';
|
|
3
|
-
import VcsObject from '../
|
|
3
|
+
import VcsObject from '../vcsObject.js';
|
|
4
4
|
import Extent from '../util/extent.js';
|
|
5
|
-
import { getGlobalHider } from './globalHider.js';
|
|
6
5
|
import { vcsLayerName } from './layerSymbols.js';
|
|
7
6
|
import LayerState from './layerState.js';
|
|
8
|
-
import VcsEvent from '../
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
7
|
+
import VcsEvent from '../vcsEvent.js';
|
|
8
|
+
import { layerClassRegistry } from '../classRegistry.js';
|
|
9
|
+
import GlobalHider from './globalHider.js';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* @typedef {Object} GenericFeature
|
|
@@ -22,8 +21,8 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* @typedef {import("@vcmap/core").Layer} SplitLayer
|
|
25
|
-
* @property {import("@vcmap/cesium").
|
|
26
|
-
* @property {VcsEvent<import("@vcmap/cesium").
|
|
24
|
+
* @property {import("@vcmap/cesium").SplitDirection} splitDirection
|
|
25
|
+
* @property {VcsEvent<import("@vcmap/cesium").SplitDirection>} splitDirectionChanged
|
|
27
26
|
*/
|
|
28
27
|
|
|
29
28
|
/**
|
|
@@ -38,7 +37,7 @@ import { VcsClassRegistry } from '../classRegistry.js';
|
|
|
38
37
|
/**
|
|
39
38
|
* @typedef {VectorPropertiesOptions} VcsMeta
|
|
40
39
|
* @property {string|undefined} version - the version of the vcsMeta schema
|
|
41
|
-
* @property {VectorStyleItemOptions|DeclarativeStyleItemOptions|
|
|
40
|
+
* @property {VectorStyleItemOptions|DeclarativeStyleItemOptions|undefined} style
|
|
42
41
|
* @property {Array<string>|undefined} embeddedIcons
|
|
43
42
|
* @property {number|undefined} screenSpaceError
|
|
44
43
|
* @property {*|undefined} flightOptions
|
|
@@ -100,13 +99,12 @@ export const vcsMetaVersion = '2.0';
|
|
|
100
99
|
* To receive implementation options, implement `geImplementationOptions`
|
|
101
100
|
* @abstract
|
|
102
101
|
* @class
|
|
103
|
-
* @export
|
|
104
102
|
* @extends {VcsObject}
|
|
105
103
|
* @api stable
|
|
106
104
|
*/
|
|
107
105
|
class Layer extends VcsObject {
|
|
108
106
|
/** @type {string} */
|
|
109
|
-
static get className() { return '
|
|
107
|
+
static get className() { return 'Layer'; }
|
|
110
108
|
|
|
111
109
|
/**
|
|
112
110
|
* Symbol to declare a layers name on its visualizations, e.g. ol.layer.Layer, Cesium.Cesium3DTileset
|
|
@@ -188,16 +186,10 @@ class Layer extends VcsObject {
|
|
|
188
186
|
|
|
189
187
|
/**
|
|
190
188
|
* @type {string|Object}
|
|
191
|
-
* @
|
|
189
|
+
* @protected
|
|
192
190
|
*/
|
|
193
191
|
this._url = options.url;
|
|
194
192
|
|
|
195
|
-
/**
|
|
196
|
-
* @type {Function}
|
|
197
|
-
* @private
|
|
198
|
-
*/
|
|
199
|
-
this._localeChangedListener = null;
|
|
200
|
-
|
|
201
193
|
/**
|
|
202
194
|
* @type {number}
|
|
203
195
|
* @private
|
|
@@ -214,12 +206,19 @@ class Layer extends VcsObject {
|
|
|
214
206
|
/**
|
|
215
207
|
* array of object Ids which should be hidden within the context of the layers layerCollection, if this layer is active
|
|
216
208
|
* @type {Array.<string>}
|
|
209
|
+
* @private
|
|
217
210
|
* @api
|
|
218
211
|
*/
|
|
219
|
-
this.
|
|
212
|
+
this._hiddenObjectIds = Array.isArray(options.hiddenObjectIds) ?
|
|
220
213
|
options.hiddenObjectIds :
|
|
221
214
|
defaultOptions.hiddenObjectIds;
|
|
222
215
|
|
|
216
|
+
/**
|
|
217
|
+
* @type {import("@vcmap/core").GlobalHider|null}
|
|
218
|
+
* @private
|
|
219
|
+
*/
|
|
220
|
+
this._globalHider = null;
|
|
221
|
+
|
|
223
222
|
/**
|
|
224
223
|
* @type {Array<string|symbol>}
|
|
225
224
|
* @private
|
|
@@ -235,9 +234,6 @@ class Layer extends VcsObject {
|
|
|
235
234
|
*/
|
|
236
235
|
this.exclusiveGroupsChanged = new VcsEvent();
|
|
237
236
|
|
|
238
|
-
/** @type {import("@vcmap/core").GlobalHider} */
|
|
239
|
-
this.globalHider = getGlobalHider();
|
|
240
|
-
|
|
241
237
|
/**
|
|
242
238
|
* @type {CopyrightOptions|undefined}
|
|
243
239
|
*/
|
|
@@ -268,6 +264,12 @@ class Layer extends VcsObject {
|
|
|
268
264
|
* @api
|
|
269
265
|
*/
|
|
270
266
|
this.featureProvider = undefined;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* @type {string}
|
|
270
|
+
* @private
|
|
271
|
+
*/
|
|
272
|
+
this._locale = 'en';
|
|
271
273
|
}
|
|
272
274
|
|
|
273
275
|
/**
|
|
@@ -332,9 +334,8 @@ class Layer extends VcsObject {
|
|
|
332
334
|
if (typeof this._url === 'string') {
|
|
333
335
|
return this._url;
|
|
334
336
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
return this._url[locale];
|
|
337
|
+
if (this._url[this._locale]) {
|
|
338
|
+
return this._url[this._locale];
|
|
338
339
|
}
|
|
339
340
|
return Object.values(this._url)[0];
|
|
340
341
|
}
|
|
@@ -353,6 +354,42 @@ class Layer extends VcsObject {
|
|
|
353
354
|
}
|
|
354
355
|
}
|
|
355
356
|
|
|
357
|
+
/**
|
|
358
|
+
* @type {Array<string>}
|
|
359
|
+
*/
|
|
360
|
+
get hiddenObjectIds() { return this._hiddenObjectIds; }
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* @param {Array<string>} hiddenObjectIds
|
|
364
|
+
*/
|
|
365
|
+
set hiddenObjectIds(hiddenObjectIds) {
|
|
366
|
+
check(hiddenObjectIds, [String]);
|
|
367
|
+
|
|
368
|
+
if (this._globalHider && this.active) {
|
|
369
|
+
this._globalHider.hideObjects(hiddenObjectIds);
|
|
370
|
+
}
|
|
371
|
+
this._hiddenObjectIds = hiddenObjectIds;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* @type {import("@vcmap/core").GlobalHider|null}
|
|
377
|
+
* @readonly
|
|
378
|
+
*/
|
|
379
|
+
get globalHider() { return this._globalHider; }
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* @param {import("@vcmap/core").GlobalHider} globalHider
|
|
383
|
+
*/
|
|
384
|
+
setGlobalHider(globalHider) {
|
|
385
|
+
checkMaybe(globalHider, GlobalHider);
|
|
386
|
+
|
|
387
|
+
if (globalHider && this.active) {
|
|
388
|
+
globalHider.hideObjects(this.hiddenObjectIds);
|
|
389
|
+
}
|
|
390
|
+
this._globalHider = globalHider;
|
|
391
|
+
}
|
|
392
|
+
|
|
356
393
|
/**
|
|
357
394
|
* Indicates, that this layer is part of an exclusiveGroup
|
|
358
395
|
* @api
|
|
@@ -406,6 +443,29 @@ class Layer extends VcsObject {
|
|
|
406
443
|
}
|
|
407
444
|
}
|
|
408
445
|
|
|
446
|
+
/**
|
|
447
|
+
* returns the currently set locale. Can be used to provide locale specific URLs.
|
|
448
|
+
* @type {string}
|
|
449
|
+
*/
|
|
450
|
+
get locale() {
|
|
451
|
+
return this._locale;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* sets the locale and reloads the layer the if the URL is a locale aware Object.
|
|
456
|
+
* @param {string} value
|
|
457
|
+
*/
|
|
458
|
+
set locale(value) {
|
|
459
|
+
check(value, String);
|
|
460
|
+
|
|
461
|
+
if (this._locale !== value) {
|
|
462
|
+
this._locale = value;
|
|
463
|
+
if (this._url && typeof this._url === 'object' && this._url[this._locale]) {
|
|
464
|
+
this.reload();
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
409
469
|
/**
|
|
410
470
|
* creates an array of layer implementations for the given map.
|
|
411
471
|
* @param {import("@vcmap/core").VcsMap} map Map
|
|
@@ -501,25 +561,11 @@ class Layer extends VcsObject {
|
|
|
501
561
|
return null;
|
|
502
562
|
}
|
|
503
563
|
|
|
504
|
-
/**
|
|
505
|
-
* recreates the implementations on locale change, if the url of this layer is an Object
|
|
506
|
-
* @param {string} locale
|
|
507
|
-
* @private
|
|
508
|
-
*/
|
|
509
|
-
_handleLocaleChange(locale) {
|
|
510
|
-
if (this._url && typeof this._url === 'object' && this._url[locale]) {
|
|
511
|
-
this.reload();
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
564
|
/**
|
|
516
565
|
* initializes the layer, can be used to defer loading
|
|
517
566
|
* @returns {Promise<void>}
|
|
518
567
|
*/
|
|
519
568
|
initialize() {
|
|
520
|
-
if (!this.initialized) {
|
|
521
|
-
this._localeChangedListener = getLocaleChangedEvent().addEventListener(this._handleLocaleChange.bind(this));
|
|
522
|
-
}
|
|
523
569
|
this._initialized = true;
|
|
524
570
|
return Promise.resolve();
|
|
525
571
|
}
|
|
@@ -617,7 +663,9 @@ class Layer extends VcsObject {
|
|
|
617
663
|
if (this._state !== LayerState.LOADING) {
|
|
618
664
|
return;
|
|
619
665
|
}
|
|
620
|
-
|
|
666
|
+
if (this._globalHider) {
|
|
667
|
+
this._globalHider.hideObjects(this.hiddenObjectIds);
|
|
668
|
+
}
|
|
621
669
|
this._state = LayerState.ACTIVE;
|
|
622
670
|
try {
|
|
623
671
|
this.stateChanged.raiseEvent(LayerState.ACTIVE);
|
|
@@ -667,7 +715,9 @@ class Layer extends VcsObject {
|
|
|
667
715
|
impl.deactivate();
|
|
668
716
|
}
|
|
669
717
|
});
|
|
670
|
-
|
|
718
|
+
if (this._globalHider) {
|
|
719
|
+
this._globalHider.showObjects(this.hiddenObjectIds);
|
|
720
|
+
}
|
|
671
721
|
this._state = LayerState.INACTIVE;
|
|
672
722
|
try {
|
|
673
723
|
this.stateChanged.raiseEvent(LayerState.INACTIVE);
|
|
@@ -736,10 +786,6 @@ class Layer extends VcsObject {
|
|
|
736
786
|
impl.destroy();
|
|
737
787
|
});
|
|
738
788
|
|
|
739
|
-
if (this._localeChangedListener) {
|
|
740
|
-
this._localeChangedListener();
|
|
741
|
-
this._localeChangedListener = null;
|
|
742
|
-
}
|
|
743
789
|
this._initialized = false;
|
|
744
790
|
this._implementations.clear();
|
|
745
791
|
this.stateChanged.destroy();
|
|
@@ -748,5 +794,5 @@ class Layer extends VcsObject {
|
|
|
748
794
|
}
|
|
749
795
|
}
|
|
750
796
|
|
|
751
|
-
|
|
797
|
+
layerClassRegistry.registerClass(Layer.className, Layer);
|
|
752
798
|
export default Layer;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import VcsObject from '../
|
|
1
|
+
import VcsObject from '../vcsObject.js';
|
|
2
2
|
import LayerState from './layerState.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* represents an implementation for a Layer for a specific Map
|
|
6
6
|
* @class
|
|
7
|
-
* @export
|
|
8
7
|
* @extends {VcsObject}
|
|
9
8
|
* @abstract
|
|
10
9
|
* @api
|
|
11
10
|
* @template {import("@vcmap/core").VcsMap} T
|
|
12
11
|
*/
|
|
13
12
|
class LayerImplementation extends VcsObject {
|
|
14
|
-
static get className() { return '
|
|
13
|
+
static get className() { return 'LayerImplementation'; }
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* @param {T} map
|
|
File without changes
|
|
@@ -3,12 +3,12 @@ import { vcsLayerName } from '../layerSymbols.js';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @class
|
|
6
|
-
* @extends {LayerImplementation<import("@vcmap/core").
|
|
6
|
+
* @extends {LayerImplementation<import("@vcmap/core").ObliqueMap>}}
|
|
7
7
|
* @abstract
|
|
8
8
|
*/
|
|
9
|
-
class
|
|
9
|
+
class LayerObliqueImpl extends LayerImplementation {
|
|
10
10
|
/**
|
|
11
|
-
* @param {import("@vcmap/core").
|
|
11
|
+
* @param {import("@vcmap/core").ObliqueMap} map
|
|
12
12
|
* @param {LayerImplementationOptions} options
|
|
13
13
|
*/
|
|
14
14
|
constructor(map, options) {
|
|
@@ -73,4 +73,4 @@ class LayerOblique extends LayerImplementation {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
export default
|
|
76
|
+
export default LayerObliqueImpl;
|
|
@@ -91,7 +91,7 @@ export async function mercatorGeometryToImageGeometry(inputSourceGeometry, desti
|
|
|
91
91
|
const coordinates = sourceGeometry.getCoordinates();
|
|
92
92
|
/** type {Array.<import("ol/coordinate").Coordinate>} */
|
|
93
93
|
const flattenCoordinates = getFlatCoordinatesFromGeometry(sourceGeometry, coordinates);
|
|
94
|
-
let transformer = getTransform(mercatorProjection.proj, image.meta.projection);
|
|
94
|
+
let transformer = getTransform(mercatorProjection.proj, image.meta.projection.proj);
|
|
95
95
|
|
|
96
96
|
let updatedPositions = [];
|
|
97
97
|
if (image.meta.terrainProvider) {
|
|
@@ -99,7 +99,7 @@ export async function mercatorGeometryToImageGeometry(inputSourceGeometry, desti
|
|
|
99
99
|
Projection.mercatorToWgs84(coord, true);
|
|
100
100
|
return Cartographic.fromDegrees(coord[0], coord[1]);
|
|
101
101
|
});
|
|
102
|
-
transformer = getTransform(wgs84Projection.proj, image.meta.projection);
|
|
102
|
+
transformer = getTransform(wgs84Projection.proj, image.meta.projection.proj);
|
|
103
103
|
updatedPositions = await sampleTerrainMostDetailed(image.meta.terrainProvider, cartographicCoordinates);
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -5,7 +5,6 @@ import Feature from 'ol/Feature.js';
|
|
|
5
5
|
|
|
6
6
|
import { mercatorProjection } from '../../util/projection.js';
|
|
7
7
|
import { mercatorGeometryToImageGeometry, imageGeometryToMercatorGeometry, getPolygonizedGeometry, setNewGeometry } from './obliqueHelpers.js';
|
|
8
|
-
import { getGlobalHider } from '../globalHider.js';
|
|
9
8
|
import {
|
|
10
9
|
actuallyIsCircle,
|
|
11
10
|
alreadyTransformedToImage,
|
|
@@ -13,21 +12,20 @@ import {
|
|
|
13
12
|
obliqueGeometry,
|
|
14
13
|
originalFeatureSymbol,
|
|
15
14
|
} from '../vectorSymbols.js';
|
|
16
|
-
import
|
|
15
|
+
import LayerObliqueImpl from './layerObliqueImpl.js';
|
|
17
16
|
import { synchronizeFeatureVisibilityWithSource } from '../vectorHelpers.js';
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* represents a specific vector layer for oblique.
|
|
21
20
|
* @class
|
|
22
|
-
* @
|
|
23
|
-
* @extends {LayerOblique}
|
|
21
|
+
* @extends {LayerObliqueImpl}
|
|
24
22
|
* @implements {FeatureLayerImplementation}
|
|
25
23
|
*/
|
|
26
|
-
class
|
|
27
|
-
static get className() { return '
|
|
24
|
+
class VectorObliqueImpl extends LayerObliqueImpl {
|
|
25
|
+
static get className() { return 'VectorObliqueImpl'; }
|
|
28
26
|
|
|
29
27
|
/**
|
|
30
|
-
* @param {import("@vcmap/core").
|
|
28
|
+
* @param {import("@vcmap/core").ObliqueMap} map
|
|
31
29
|
* @param {VectorImplementationOptions} options
|
|
32
30
|
*/
|
|
33
31
|
constructor(map, options) {
|
|
@@ -75,7 +73,7 @@ class VectorOblique extends LayerOblique {
|
|
|
75
73
|
/**
|
|
76
74
|
* @type {import("@vcmap/core").GlobalHider}
|
|
77
75
|
*/
|
|
78
|
-
this.globalHider =
|
|
76
|
+
this.globalHider = options.globalHider;
|
|
79
77
|
/**
|
|
80
78
|
* @type {import("ol/source").Vector<import("ol/geom/Geometry").default>}
|
|
81
79
|
*/
|
|
@@ -466,4 +464,4 @@ class VectorOblique extends LayerOblique {
|
|
|
466
464
|
}
|
|
467
465
|
}
|
|
468
466
|
|
|
469
|
-
export default
|
|
467
|
+
export default VectorObliqueImpl;
|