@vcmap/core 6.0.0-rc.9 → 6.0.1
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/README.md +4 -1
- package/dist/cesium.d.ts +117 -0
- package/dist/index.d.ts +14 -6
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/ol.d.ts +1 -0
- package/dist/src/cesium/cesium3DTileFeature.d.ts +2 -1
- package/dist/src/cesium/cesium3DTileFeature.js +13 -1
- package/dist/src/cesium/cesium3DTileFeature.js.map +1 -1
- package/dist/src/cesium/cesium3DTilePointFeature.js +2 -0
- package/dist/src/cesium/cesium3DTilePointFeature.js.map +1 -1
- package/dist/src/cesium/entity.js +3 -0
- package/dist/src/cesium/entity.js.map +1 -1
- package/dist/src/interaction/featureAtPixelInteraction.d.ts +4 -12
- package/dist/src/interaction/featureAtPixelInteraction.js +6 -27
- package/dist/src/interaction/featureAtPixelInteraction.js.map +1 -1
- package/dist/src/layer/cesium/openStreetMapCesiumImpl.js +2 -4
- package/dist/src/layer/cesium/openStreetMapCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/rasterLayerCesiumImpl.d.ts +4 -0
- package/dist/src/layer/cesium/rasterLayerCesiumImpl.js +15 -0
- package/dist/src/layer/cesium/rasterLayerCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/singleImageCesiumImpl.js +2 -6
- package/dist/src/layer/cesium/singleImageCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/terrainCesiumImpl.js +3 -0
- package/dist/src/layer/cesium/terrainCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/tmsCesiumImpl.js +1 -4
- package/dist/src/layer/cesium/tmsCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vcsTile/vcsChildTile.d.ts +12 -0
- package/dist/src/layer/cesium/vcsTile/vcsChildTile.js +18 -0
- package/dist/src/layer/cesium/vcsTile/vcsChildTile.js.map +1 -0
- package/dist/src/layer/cesium/vcsTile/vcsDebugTile.d.ts +21 -0
- package/dist/src/layer/cesium/vcsTile/vcsDebugTile.js +89 -0
- package/dist/src/layer/cesium/vcsTile/vcsDebugTile.js.map +1 -0
- package/dist/src/layer/cesium/vcsTile/vcsNoDataTile.d.ts +11 -0
- package/dist/src/layer/cesium/vcsTile/vcsNoDataTile.js +17 -0
- package/dist/src/layer/cesium/vcsTile/vcsNoDataTile.js.map +1 -0
- package/dist/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.d.ts +39 -0
- package/dist/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.js +192 -0
- package/dist/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.js.map +1 -0
- package/dist/src/layer/cesium/vcsTile/vcsTileHelpers.d.ts +52 -0
- package/dist/src/layer/cesium/vcsTile/vcsTileHelpers.js +73 -0
- package/dist/src/layer/cesium/vcsTile/vcsTileHelpers.js.map +1 -0
- package/dist/src/layer/cesium/vcsTile/vcsVectorTile.d.ts +23 -0
- package/dist/src/layer/cesium/vcsTile/vcsVectorTile.js +87 -0
- package/dist/src/layer/cesium/vcsTile/vcsVectorTile.js.map +1 -0
- package/dist/src/layer/cesium/vectorCesiumImpl.js +1 -1
- package/dist/src/layer/cesium/vectorCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/vectorTileCesiumImpl.d.ts +19 -0
- package/dist/src/layer/cesium/vectorTileCesiumImpl.js +63 -0
- package/dist/src/layer/cesium/vectorTileCesiumImpl.js.map +1 -0
- package/dist/src/layer/cesium/wmsCesiumImpl.js +1 -4
- package/dist/src/layer/cesium/wmsCesiumImpl.js.map +1 -1
- package/dist/src/layer/cesium/wmtsCesiumImpl.js +1 -4
- package/dist/src/layer/cesium/wmtsCesiumImpl.js.map +1 -1
- package/dist/src/layer/layer.d.ts +5 -0
- package/dist/src/layer/layer.js +5 -0
- package/dist/src/layer/layer.js.map +1 -1
- package/dist/src/layer/openStreetMapLayer.d.ts +32 -2
- package/dist/src/layer/openStreetMapLayer.js +35 -1
- package/dist/src/layer/openStreetMapLayer.js.map +1 -1
- package/dist/src/layer/openlayers/openStreetMapOpenlayersImpl.js +2 -0
- package/dist/src/layer/openlayers/openStreetMapOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/rasterLayerOpenlayersImpl.d.ts +2 -0
- package/dist/src/layer/openlayers/rasterLayerOpenlayersImpl.js +4 -0
- package/dist/src/layer/openlayers/rasterLayerOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/singleImageOpenlayersImpl.js +2 -0
- package/dist/src/layer/openlayers/singleImageOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/tmsOpenlayersImpl.js +2 -0
- package/dist/src/layer/openlayers/tmsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.d.ts +1 -7
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js +3 -35
- package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/wmsOpenlayersImpl.js +4 -0
- package/dist/src/layer/openlayers/wmsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/openlayers/wmtsOpenlayersImpl.js +2 -0
- package/dist/src/layer/openlayers/wmtsOpenlayersImpl.js.map +1 -1
- package/dist/src/layer/pointCloudLayer.d.ts +0 -1
- package/dist/src/layer/pointCloudLayer.js +2 -3
- package/dist/src/layer/pointCloudLayer.js.map +1 -1
- package/dist/src/layer/rasterLayer.d.ts +44 -3
- package/dist/src/layer/rasterLayer.js +43 -0
- package/dist/src/layer/rasterLayer.js.map +1 -1
- package/dist/src/layer/tileProvider/mvtTileProvider.d.ts +0 -5
- package/dist/src/layer/tileProvider/mvtTileProvider.js +0 -12
- package/dist/src/layer/tileProvider/mvtTileProvider.js.map +1 -1
- package/dist/src/layer/tileProvider/staticFeatureTileProvider.d.ts +14 -0
- package/dist/src/layer/tileProvider/staticFeatureTileProvider.js +44 -0
- package/dist/src/layer/tileProvider/staticFeatureTileProvider.js.map +1 -0
- package/dist/src/layer/tileProvider/tileProvider.d.ts +8 -2
- package/dist/src/layer/tileProvider/tileProvider.js +17 -1
- package/dist/src/layer/tileProvider/tileProvider.js.map +1 -1
- package/dist/src/layer/vectorLayer.d.ts +1 -1
- package/dist/src/layer/vectorLayer.js.map +1 -1
- package/dist/src/layer/vectorTileLayer.d.ts +13 -3
- package/dist/src/layer/vectorTileLayer.js +43 -13
- package/dist/src/layer/vectorTileLayer.js.map +1 -1
- package/dist/src/map/cesiumMap.d.ts +8 -1
- package/dist/src/map/cesiumMap.js +17 -6
- package/dist/src/map/cesiumMap.js.map +1 -1
- package/dist/src/ol/feature.js +7 -0
- package/dist/src/ol/feature.js.map +1 -1
- package/dist/src/style/declarativeStyleItem.js +2 -68
- package/dist/src/style/declarativeStyleItem.js.map +1 -1
- package/dist/src/util/displayQuality/displayQuality.d.ts +1 -0
- package/dist/src/util/displayQuality/displayQuality.js +12 -1
- package/dist/src/util/displayQuality/displayQuality.js.map +1 -1
- package/dist/src/util/editor/createFeatureSession.d.ts +8 -4
- package/dist/src/util/editor/createFeatureSession.js +35 -11
- package/dist/src/util/editor/createFeatureSession.js.map +1 -1
- package/dist/src/util/editor/editGeometrySession.d.ts +2 -1
- package/dist/src/util/editor/editGeometrySession.js +33 -12
- package/dist/src/util/editor/editGeometrySession.js.map +1 -1
- package/dist/src/util/editor/editorHelpers.d.ts +1 -0
- package/dist/src/util/editor/editorHelpers.js +6 -0
- package/dist/src/util/editor/editorHelpers.js.map +1 -1
- package/dist/src/util/editor/editorSessionHelpers.d.ts +1 -6
- package/dist/src/util/editor/editorSessionHelpers.js +5 -16
- package/dist/src/util/editor/editorSessionHelpers.js.map +1 -1
- package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js +3 -2
- package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/removeVertexInteraction.d.ts +1 -1
- package/dist/src/util/editor/interactions/removeVertexInteraction.js +2 -2
- package/dist/src/util/editor/interactions/removeVertexInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/segmentLengthInteraction.d.ts +16 -0
- package/dist/src/util/editor/interactions/segmentLengthInteraction.js +167 -0
- package/dist/src/util/editor/interactions/segmentLengthInteraction.js.map +1 -0
- package/dist/src/util/editor/interactions/translateVertexInteraction.js +2 -6
- package/dist/src/util/editor/interactions/translateVertexInteraction.js.map +1 -1
- package/dist/src/util/editor/interactions/translationSnapping.js +3 -2
- package/dist/src/util/editor/interactions/translationSnapping.js.map +1 -1
- package/dist/src/util/featureconverter/clampedPrimitive.d.ts +2 -2
- package/dist/src/util/featureconverter/clampedPrimitive.js +24 -2
- package/dist/src/util/featureconverter/clampedPrimitive.js.map +1 -1
- package/dist/src/util/featureconverter/convert.js +12 -3
- package/dist/src/util/featureconverter/convert.js.map +1 -1
- package/dist/src/util/geometryHelpers.d.ts +9 -1
- package/dist/src/util/geometryHelpers.js +54 -4
- package/dist/src/util/geometryHelpers.js.map +1 -1
- package/dist/src/util/math.d.ts +12 -0
- package/dist/src/util/math.js +21 -0
- package/dist/src/util/math.js.map +1 -1
- package/dist/src/util/projection.js +1 -1
- package/dist/src/util/projection.js.map +1 -1
- package/dist/src/vcsModule.d.ts +12 -12
- package/dist/src/vcsModule.js +8 -8
- package/dist/src/vcsModule.js.map +1 -1
- package/dist/tests/unit/helpers/cesiumHelpers.d.ts +2 -2
- package/dist/tests/unit/helpers/cesiumHelpers.js +2 -1
- package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -1
- package/index.ts +26 -2
- package/package.json +3 -3
- package/src/cesium/cesium.d.ts +117 -0
- package/src/cesium/cesium3DTileFeature.ts +20 -1
- package/src/cesium/cesium3DTilePointFeature.ts +3 -0
- package/src/cesium/entity.ts +7 -0
- package/src/interaction/featureAtPixelInteraction.ts +8 -39
- package/src/layer/cesium/openStreetMapCesiumImpl.ts +2 -4
- package/src/layer/cesium/rasterLayerCesiumImpl.ts +19 -0
- package/src/layer/cesium/singleImageCesiumImpl.ts +2 -6
- package/src/layer/cesium/terrainCesiumImpl.ts +3 -0
- package/src/layer/cesium/tmsCesiumImpl.ts +1 -4
- package/src/layer/cesium/vcsTile/vcsChildTile.ts +31 -0
- package/src/layer/cesium/vcsTile/vcsDebugTile.ts +154 -0
- package/src/layer/cesium/vcsTile/vcsNoDataTile.ts +30 -0
- package/src/layer/cesium/vcsTile/vcsQuadtreeTileProvider.ts +290 -0
- package/src/layer/cesium/vcsTile/vcsTileHelpers.ts +134 -0
- package/src/layer/cesium/vcsTile/vcsVectorTile.ts +149 -0
- package/src/layer/cesium/vectorCesiumImpl.ts +1 -1
- package/src/layer/cesium/vectorTileCesiumImpl.ts +91 -0
- package/src/layer/cesium/wmsCesiumImpl.ts +1 -4
- package/src/layer/cesium/wmtsCesiumImpl.ts +1 -4
- package/src/layer/layer.ts +5 -0
- package/src/layer/openStreetMapLayer.ts +64 -2
- package/src/layer/openlayers/openStreetMapOpenlayersImpl.ts +2 -0
- package/src/layer/openlayers/rasterLayerOpenlayersImpl.ts +6 -0
- package/src/layer/openlayers/singleImageOpenlayersImpl.ts +2 -0
- package/src/layer/openlayers/tmsOpenlayersImpl.ts +2 -0
- package/src/layer/openlayers/vectorTileOpenlayersImpl.ts +3 -37
- package/src/layer/openlayers/wmsOpenlayersImpl.ts +4 -0
- package/src/layer/openlayers/wmtsOpenlayersImpl.ts +2 -0
- package/src/layer/pointCloudLayer.ts +2 -3
- package/src/layer/rasterLayer.ts +81 -2
- package/src/layer/tileProvider/mvtTileProvider.ts +0 -18
- package/src/layer/tileProvider/staticFeatureTileProvider.ts +61 -0
- package/src/layer/tileProvider/tileProvider.ts +27 -2
- package/src/layer/vectorLayer.ts +1 -1
- package/src/layer/vectorTileLayer.ts +72 -17
- package/src/map/cesiumMap.ts +28 -6
- package/src/ol/feature.ts +10 -0
- package/src/ol/ol.d.ts +1 -0
- package/src/style/declarativeStyleItem.ts +2 -72
- package/src/util/displayQuality/displayQuality.ts +13 -1
- package/src/util/editor/createFeatureSession.ts +51 -13
- package/src/util/editor/editGeometrySession.ts +41 -10
- package/src/util/editor/editorHelpers.ts +13 -0
- package/src/util/editor/editorSessionHelpers.ts +6 -20
- package/src/util/editor/interactions/editGeometryMouseOverInteraction.ts +4 -4
- package/src/util/editor/interactions/removeVertexInteraction.ts +3 -4
- package/src/util/editor/interactions/segmentLengthInteraction.ts +227 -0
- package/src/util/editor/interactions/translateVertexInteraction.ts +3 -10
- package/src/util/editor/interactions/translationSnapping.ts +4 -4
- package/src/util/featureconverter/clampedPrimitive.ts +53 -5
- package/src/util/featureconverter/convert.ts +18 -2
- package/src/util/geometryHelpers.ts +63 -4
- package/src/util/math.ts +28 -0
- package/src/util/projection.ts +1 -1
- package/src/vcsModule.ts +20 -20
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HeightReference,
|
|
3
|
+
Math as CesiumMath,
|
|
4
|
+
PrimitiveCollection,
|
|
5
|
+
QuadtreeTile,
|
|
6
|
+
Rectangle,
|
|
7
|
+
SplitDirection,
|
|
8
|
+
TileBoundingRegion,
|
|
9
|
+
TilingScheme,
|
|
10
|
+
} from '@vcmap-cesium/engine';
|
|
11
|
+
import { StyleLike } from 'ol/style/Style.js';
|
|
12
|
+
import { Extent as OLExtent } from 'ol/extent.js';
|
|
13
|
+
import type CesiumMap from '../../../map/cesiumMap.js';
|
|
14
|
+
import Projection from '../../../util/projection.js';
|
|
15
|
+
import TileProvider from '../../tileProvider/tileProvider.js';
|
|
16
|
+
import VectorProperties from '../../vectorProperties.js';
|
|
17
|
+
|
|
18
|
+
export enum VcsTileState {
|
|
19
|
+
LOADING,
|
|
20
|
+
PROCESSING,
|
|
21
|
+
READY,
|
|
22
|
+
FAILED,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export enum VcsTileType {
|
|
26
|
+
VECTOR,
|
|
27
|
+
CHILD,
|
|
28
|
+
NO_DATA,
|
|
29
|
+
DEBUG,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type VcsTileOptions = {
|
|
33
|
+
map: CesiumMap;
|
|
34
|
+
primitiveCollection: PrimitiveCollection;
|
|
35
|
+
style: StyleLike;
|
|
36
|
+
tileProvider: TileProvider;
|
|
37
|
+
name: string;
|
|
38
|
+
vectorProperties: VectorProperties;
|
|
39
|
+
splitDirection: SplitDirection;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export interface VcsTile {
|
|
43
|
+
state: VcsTileState;
|
|
44
|
+
type: VcsTileType;
|
|
45
|
+
tileBoundingRegion: TileBoundingRegion;
|
|
46
|
+
show: boolean;
|
|
47
|
+
freeResources?: () => void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* returns the extent of the tile in wgs84 degrees
|
|
52
|
+
* @param tile
|
|
53
|
+
* @param tilingScheme
|
|
54
|
+
*/
|
|
55
|
+
export function getTileWgs84Extent(
|
|
56
|
+
tile: QuadtreeTile,
|
|
57
|
+
tilingScheme: TilingScheme,
|
|
58
|
+
): OLExtent {
|
|
59
|
+
const tileRect = tilingScheme.tileXYToRectangle(tile.x, tile.y, tile.level);
|
|
60
|
+
|
|
61
|
+
return [
|
|
62
|
+
CesiumMath.toDegrees(tileRect.west),
|
|
63
|
+
CesiumMath.toDegrees(tileRect.south),
|
|
64
|
+
CesiumMath.toDegrees(tileRect.east),
|
|
65
|
+
CesiumMath.toDegrees(tileRect.north),
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* returns the extent of the tile in web mercator
|
|
71
|
+
* @param tile
|
|
72
|
+
* @param tilingScheme
|
|
73
|
+
*/
|
|
74
|
+
export function getTileWebMercatorExtent(
|
|
75
|
+
tile: QuadtreeTile,
|
|
76
|
+
tilingScheme: TilingScheme,
|
|
77
|
+
): OLExtent {
|
|
78
|
+
const wgs84Extent = getTileWgs84Extent(tile, tilingScheme);
|
|
79
|
+
const min = Projection.wgs84ToMercator([wgs84Extent[0], wgs84Extent[1]]);
|
|
80
|
+
const max = Projection.wgs84ToMercator([wgs84Extent[2], wgs84Extent[3]]);
|
|
81
|
+
|
|
82
|
+
return [min[0], min[1], max[0], max[1]];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function getTileBoundingRegion(
|
|
86
|
+
tile: QuadtreeTile<VcsTile>,
|
|
87
|
+
map: CesiumMap,
|
|
88
|
+
): TileBoundingRegion {
|
|
89
|
+
const height =
|
|
90
|
+
map
|
|
91
|
+
.getScene()
|
|
92
|
+
?.getHeight(
|
|
93
|
+
Rectangle.center(tile.rectangle),
|
|
94
|
+
HeightReference.CLAMP_TO_GROUND,
|
|
95
|
+
) ?? 0;
|
|
96
|
+
|
|
97
|
+
return new TileBoundingRegion({
|
|
98
|
+
rectangle: tile.rectangle,
|
|
99
|
+
maximumHeight: height,
|
|
100
|
+
minimumHeight: height,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function getDataTiles(
|
|
105
|
+
minLevel: number,
|
|
106
|
+
maxLevel: number,
|
|
107
|
+
tileProvider: TileProvider,
|
|
108
|
+
): {
|
|
109
|
+
dataLevels: Set<number>;
|
|
110
|
+
dataRange: [number, number];
|
|
111
|
+
} {
|
|
112
|
+
const dataLevels = new Set<number>();
|
|
113
|
+
for (let i = minLevel; i <= maxLevel; i++) {
|
|
114
|
+
const baseLevel = tileProvider.getBaseLevel(i);
|
|
115
|
+
if (baseLevel != null) {
|
|
116
|
+
const toAdd = baseLevel < minLevel ? minLevel : baseLevel;
|
|
117
|
+
dataLevels.add(toAdd);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (dataLevels.size === 0) {
|
|
122
|
+
throw new Error('No base levels for this tile data set');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const lastDataLevel = [...dataLevels].at(-1)!;
|
|
126
|
+
return {
|
|
127
|
+
dataLevels,
|
|
128
|
+
dataRange: [minLevel, lastDataLevel > minLevel ? lastDataLevel : minLevel],
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function getTileHash(tile: QuadtreeTile): string {
|
|
133
|
+
return `${tile.level}/${tile.x}/${tile.y}`;
|
|
134
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PrimitiveCollection,
|
|
3
|
+
QuadtreeTile,
|
|
4
|
+
TileBoundingRegion,
|
|
5
|
+
} from '@vcmap-cesium/engine';
|
|
6
|
+
import { getLogger } from '@vcsuite/logger';
|
|
7
|
+
import { EventsKey } from 'ol/events.js';
|
|
8
|
+
import { unByKey } from 'ol/Observable.js';
|
|
9
|
+
import { containsCoordinate, getCenter } from 'ol/extent.js';
|
|
10
|
+
import { StyleLike } from 'ol/style/Style.js';
|
|
11
|
+
import VectorContext from '../vectorContext.js';
|
|
12
|
+
import { vcsLayerName } from '../../layerSymbols.js';
|
|
13
|
+
import {
|
|
14
|
+
getTileBoundingRegion,
|
|
15
|
+
getTileWebMercatorExtent,
|
|
16
|
+
VcsTile,
|
|
17
|
+
VcsTileOptions,
|
|
18
|
+
VcsTileState,
|
|
19
|
+
VcsTileType,
|
|
20
|
+
} from './vcsTileHelpers.js';
|
|
21
|
+
import CesiumMap from '../../../map/cesiumMap.js';
|
|
22
|
+
import { TileProvider } from '../../../../index.js';
|
|
23
|
+
import VectorProperties from '../../vectorProperties.js';
|
|
24
|
+
|
|
25
|
+
export default class VcsVectorTile implements VcsTile {
|
|
26
|
+
state = VcsTileState.LOADING;
|
|
27
|
+
|
|
28
|
+
type = VcsTileType.VECTOR;
|
|
29
|
+
|
|
30
|
+
tileBoundingRegion: TileBoundingRegion;
|
|
31
|
+
|
|
32
|
+
private _tile: QuadtreeTile<VcsTile>;
|
|
33
|
+
|
|
34
|
+
private _vectorContext: VectorContext;
|
|
35
|
+
|
|
36
|
+
private _rootCollection = new PrimitiveCollection();
|
|
37
|
+
|
|
38
|
+
private _featureListeners: EventsKey[] = [];
|
|
39
|
+
|
|
40
|
+
private _map: CesiumMap;
|
|
41
|
+
|
|
42
|
+
private _tileProvider: TileProvider;
|
|
43
|
+
|
|
44
|
+
private _style: StyleLike;
|
|
45
|
+
|
|
46
|
+
private _vectorProperties: VectorProperties;
|
|
47
|
+
|
|
48
|
+
private _layerPrimitiveCollection: PrimitiveCollection;
|
|
49
|
+
|
|
50
|
+
private _isDestroyed: boolean;
|
|
51
|
+
|
|
52
|
+
constructor(tile: QuadtreeTile<VcsTile>, options: VcsTileOptions) {
|
|
53
|
+
this._tile = tile;
|
|
54
|
+
this._map = options.map;
|
|
55
|
+
this._tileProvider = options.tileProvider;
|
|
56
|
+
this._style = options.style;
|
|
57
|
+
this._vectorProperties = options.vectorProperties;
|
|
58
|
+
this._layerPrimitiveCollection = options.primitiveCollection;
|
|
59
|
+
|
|
60
|
+
this._vectorContext = new VectorContext(
|
|
61
|
+
options.map,
|
|
62
|
+
this._rootCollection,
|
|
63
|
+
options.splitDirection,
|
|
64
|
+
);
|
|
65
|
+
this._rootCollection[vcsLayerName] = options.name;
|
|
66
|
+
this._rootCollection.show = false;
|
|
67
|
+
options.primitiveCollection.add(this._rootCollection);
|
|
68
|
+
|
|
69
|
+
this.tileBoundingRegion = getTileBoundingRegion(tile, options.map);
|
|
70
|
+
this._load().catch(() => {
|
|
71
|
+
this.state = VcsTileState.FAILED;
|
|
72
|
+
});
|
|
73
|
+
this._isDestroyed = false;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private async _load(): Promise<void> {
|
|
77
|
+
this.state = VcsTileState.LOADING;
|
|
78
|
+
const scene = this._map.getScene()!;
|
|
79
|
+
|
|
80
|
+
const features = await this._tileProvider.getFeaturesForTile(
|
|
81
|
+
this._tile.x,
|
|
82
|
+
this._tile.y,
|
|
83
|
+
this._tile.level,
|
|
84
|
+
);
|
|
85
|
+
if (this._isDestroyed) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const tileWebmercator = getTileWebMercatorExtent(
|
|
89
|
+
this._tile,
|
|
90
|
+
this._tileProvider.tilingScheme,
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
this.state = VcsTileState.PROCESSING;
|
|
94
|
+
await Promise.all(
|
|
95
|
+
features.map(async (f) => {
|
|
96
|
+
if (this._isDestroyed) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const featureExtent = f.getGeometry()?.getExtent();
|
|
100
|
+
if (
|
|
101
|
+
featureExtent &&
|
|
102
|
+
containsCoordinate(tileWebmercator, getCenter(featureExtent))
|
|
103
|
+
) {
|
|
104
|
+
this._featureListeners.push(
|
|
105
|
+
f.on('change', () => {
|
|
106
|
+
this._vectorContext
|
|
107
|
+
.addFeature(f, this._style, this._vectorProperties, scene)
|
|
108
|
+
.catch(() => {
|
|
109
|
+
getLogger('VcsVectorTile').error(
|
|
110
|
+
'failed to add changed feature',
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
}),
|
|
114
|
+
);
|
|
115
|
+
await this._vectorContext.addFeature(
|
|
116
|
+
f,
|
|
117
|
+
this._style,
|
|
118
|
+
this._vectorProperties,
|
|
119
|
+
scene,
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
}),
|
|
123
|
+
);
|
|
124
|
+
if (this._isDestroyed) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
this.state = VcsTileState.READY;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
get show(): boolean {
|
|
131
|
+
return this._rootCollection.show;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
set show(show: boolean) {
|
|
135
|
+
this._rootCollection.show = show;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
freeResources(): void {
|
|
139
|
+
this.destroy();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
destroy(): void {
|
|
143
|
+
unByKey(this._featureListeners);
|
|
144
|
+
this._isDestroyed = true;
|
|
145
|
+
this._vectorContext.destroy();
|
|
146
|
+
this._layerPrimitiveCollection.remove(this._rootCollection);
|
|
147
|
+
this._tile.data = undefined;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -91,7 +91,7 @@ class VectorCesiumImpl
|
|
|
91
91
|
|
|
92
92
|
this._olListeners.push(
|
|
93
93
|
this.source.on('changefeature', (event) => {
|
|
94
|
-
this._featureChanged(event.feature as Feature).catch(() => {
|
|
94
|
+
this._featureChanged(event.feature as Feature).catch((_e) => {
|
|
95
95
|
this.getLogger().error('failed to convert feature');
|
|
96
96
|
});
|
|
97
97
|
}),
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PrimitiveCollection,
|
|
3
|
+
QuadtreePrimitive,
|
|
4
|
+
SplitDirection,
|
|
5
|
+
} from '@vcmap-cesium/engine';
|
|
6
|
+
import StyleItem from '../../style/styleItem.js';
|
|
7
|
+
import LayerImplementation from '../layerImplementation.js';
|
|
8
|
+
import type CesiumMap from '../../map/cesiumMap.js';
|
|
9
|
+
import {
|
|
10
|
+
VectorTileImplementation,
|
|
11
|
+
VectorTileImplementationOptions,
|
|
12
|
+
} from '../vectorTileLayer.js';
|
|
13
|
+
import { vcsLayerName } from '../layerSymbols.js';
|
|
14
|
+
import VcsQuadtreeTileProvider from './vcsTile/vcsQuadtreeTileProvider.js';
|
|
15
|
+
|
|
16
|
+
export default class VectorTileCesiumImpl
|
|
17
|
+
extends LayerImplementation<CesiumMap>
|
|
18
|
+
implements VectorTileImplementation
|
|
19
|
+
{
|
|
20
|
+
static get className(): string {
|
|
21
|
+
return 'VectorTileCesiumImpl';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private _quadtreeProvider: VcsQuadtreeTileProvider;
|
|
25
|
+
|
|
26
|
+
private _quadtreePrimitive: QuadtreePrimitive;
|
|
27
|
+
|
|
28
|
+
private _primitiveCollection = new PrimitiveCollection();
|
|
29
|
+
|
|
30
|
+
constructor(map: CesiumMap, options: VectorTileImplementationOptions) {
|
|
31
|
+
super(map, options);
|
|
32
|
+
this._quadtreeProvider = new VcsQuadtreeTileProvider(
|
|
33
|
+
map,
|
|
34
|
+
this._primitiveCollection,
|
|
35
|
+
options,
|
|
36
|
+
);
|
|
37
|
+
this._quadtreePrimitive = new QuadtreePrimitive({
|
|
38
|
+
tileProvider: this._quadtreeProvider,
|
|
39
|
+
});
|
|
40
|
+
this._primitiveCollection.add(this._quadtreePrimitive);
|
|
41
|
+
this._primitiveCollection[vcsLayerName] = this.name;
|
|
42
|
+
this._primitiveCollection.show = false;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
updateTiles(_tiles: string[], featureVisibility: boolean): void {
|
|
46
|
+
if (!featureVisibility) {
|
|
47
|
+
this._quadtreePrimitive.invalidateAllTiles(); // XXX this we can do bette
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async initialize(): Promise<void> {
|
|
52
|
+
if (!this.initialized) {
|
|
53
|
+
this.map.addPrimitiveCollection(this._primitiveCollection);
|
|
54
|
+
}
|
|
55
|
+
await super.initialize();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async activate(): Promise<void> {
|
|
59
|
+
this._primitiveCollection.show = true;
|
|
60
|
+
return super.activate();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
deactivate(): void {
|
|
64
|
+
this._primitiveCollection.show = false;
|
|
65
|
+
super.deactivate();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
updateStyle(style: StyleItem, _silent?: boolean): void {
|
|
69
|
+
this._quadtreeProvider.updateStyle(style);
|
|
70
|
+
this._quadtreePrimitive.invalidateAllTiles();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
updateSplitDirection(direction: SplitDirection): void {
|
|
74
|
+
this._quadtreeProvider.updateSplitDirection(direction);
|
|
75
|
+
this._quadtreePrimitive.invalidateAllTiles();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
destroy(): void {
|
|
79
|
+
if (!this.isDestroyed) {
|
|
80
|
+
this._quadtreeProvider.destroy();
|
|
81
|
+
this._quadtreePrimitive.invalidateAllTiles();
|
|
82
|
+
if (this.map.initialized) {
|
|
83
|
+
this.map.removePrimitiveCollection(this._primitiveCollection);
|
|
84
|
+
} else {
|
|
85
|
+
this._primitiveCollection.destroy();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
super.destroy();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -65,10 +65,7 @@ class WmsCesiumImpl extends RasterLayerCesiumImpl {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
const imageryProvider = new WebMapServiceImageryProvider(options);
|
|
68
|
-
const layerOptions =
|
|
69
|
-
alpha: this.opacity,
|
|
70
|
-
splitDirection: this.splitDirection,
|
|
71
|
-
};
|
|
68
|
+
const layerOptions = this.getCesiumLayerOptions();
|
|
72
69
|
return Promise.resolve(
|
|
73
70
|
new CesiumImageryLayer(imageryProvider, layerOptions),
|
|
74
71
|
);
|
|
@@ -83,10 +83,7 @@ class WmtsCesiumImpl extends RasterLayerCesiumImpl {
|
|
|
83
83
|
options.tileMatrixLabels = this.matrixIds;
|
|
84
84
|
|
|
85
85
|
const imageryProvider = new WebMapTileServiceImageryProvider(options);
|
|
86
|
-
const layerOptions =
|
|
87
|
-
alpha: this.opacity,
|
|
88
|
-
splitDirection: this.splitDirection,
|
|
89
|
-
};
|
|
86
|
+
const layerOptions = this.getCesiumLayerOptions();
|
|
90
87
|
return Promise.resolve(
|
|
91
88
|
new CesiumImageryLayer(imageryProvider, layerOptions),
|
|
92
89
|
);
|
package/src/layer/layer.ts
CHANGED
|
@@ -106,6 +106,11 @@ class Layer<
|
|
|
106
106
|
|
|
107
107
|
private _initialized: boolean;
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* if provided, the layer will only be shown in the given MapNames.
|
|
111
|
+
* An empty array will show the layer in all configured maps.
|
|
112
|
+
* Changes require calling layer.redraw() to take effect.
|
|
113
|
+
*/
|
|
109
114
|
mapNames: string[];
|
|
110
115
|
|
|
111
116
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SplitDirection } from '@vcmap-cesium/engine';
|
|
1
|
+
import { ImageryLayer, SplitDirection } from '@vcmap-cesium/engine';
|
|
2
2
|
|
|
3
3
|
import { parseInteger, parseNumberRange } from '@vcsuite/parsers';
|
|
4
4
|
import Layer, { type LayerOptions, SplitLayer } from './layer.js';
|
|
@@ -29,6 +29,22 @@ export type OpenStreetMapOptions = LayerOptions & {
|
|
|
29
29
|
* @default 19
|
|
30
30
|
*/
|
|
31
31
|
maxLevel?: number;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* configures the visible level in the rendered map. Maps to Openlayers `minZoom` and Cesium `minimiumTerrainLevel`
|
|
35
|
+
*/
|
|
36
|
+
minRenderingLevel?: number;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* configures the visible level in the rendered map. Maps to Openlayers `maxZoom` and Cesium `maximumTerrainLevel`
|
|
40
|
+
*/
|
|
41
|
+
maxRenderingLevel?: number;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* can be used to forward options to the cesium ImageryLayer
|
|
45
|
+
* @see https://cesium.com/learn/cesiumjs/ref-doc/ImageryLayer.html#.ConstructorOptions
|
|
46
|
+
*/
|
|
47
|
+
imageryLayerOptions?: ImageryLayer.ConstructorOptions;
|
|
32
48
|
};
|
|
33
49
|
|
|
34
50
|
/**
|
|
@@ -48,6 +64,8 @@ class OpenStreetMapLayer
|
|
|
48
64
|
splitDirection: undefined,
|
|
49
65
|
opacity: 1,
|
|
50
66
|
maxLevel: 19,
|
|
67
|
+
minRenderingLevel: undefined,
|
|
68
|
+
maxRenderingLevel: undefined,
|
|
51
69
|
};
|
|
52
70
|
}
|
|
53
71
|
|
|
@@ -61,10 +79,30 @@ class OpenStreetMapLayer
|
|
|
61
79
|
splitDirectionChanged: VcsEvent<SplitDirection> = new VcsEvent();
|
|
62
80
|
|
|
63
81
|
/**
|
|
64
|
-
* The maximum level to load.
|
|
82
|
+
* The maximum level to load.
|
|
83
|
+
* Changes requires calling layer.redraw() to take effect.
|
|
65
84
|
*/
|
|
66
85
|
maxLevel: number;
|
|
67
86
|
|
|
87
|
+
/**
|
|
88
|
+
* defines the visible level in the rendered map, maps to Openlayers `minZoom` and Cesium `minimiumTerrainLevel`.
|
|
89
|
+
* Changes requires calling layer.redraw() to take effect.
|
|
90
|
+
*/
|
|
91
|
+
minRenderingLevel: number | undefined;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* defines the visible level in the rendered map, maps to Openlayers `minZoom` and Cesium `minimiumTerrainLevel`.
|
|
95
|
+
* Changes requires calling layer.redraw() to take effect.
|
|
96
|
+
*/
|
|
97
|
+
maxRenderingLevel: number | undefined;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* can be used to forward options to the cesium ImageryLayer
|
|
101
|
+
* @see https://cesium.com/learn/cesiumjs/ref-doc/ImageryLayer.html#.ConstructorOptions
|
|
102
|
+
* Changes requires calling layer.redraw() to take effect.
|
|
103
|
+
*/
|
|
104
|
+
imageryLayerOptions: ImageryLayer.ConstructorOptions | undefined;
|
|
105
|
+
|
|
68
106
|
protected _supportedMaps = [CesiumMap.className, OpenlayersMap.className];
|
|
69
107
|
|
|
70
108
|
constructor(options: OpenStreetMapOptions) {
|
|
@@ -86,6 +124,15 @@ class OpenStreetMapLayer
|
|
|
86
124
|
1.0,
|
|
87
125
|
);
|
|
88
126
|
this.maxLevel = parseInteger(options.maxLevel, defaultOptions.maxLevel);
|
|
127
|
+
this.minRenderingLevel = parseInteger(
|
|
128
|
+
options.minRenderingLevel,
|
|
129
|
+
defaultOptions.minRenderingLevel,
|
|
130
|
+
);
|
|
131
|
+
this.maxRenderingLevel = parseInteger(
|
|
132
|
+
options.maxRenderingLevel,
|
|
133
|
+
defaultOptions.maxRenderingLevel,
|
|
134
|
+
);
|
|
135
|
+
this.imageryLayerOptions = structuredClone(options.imageryLayerOptions);
|
|
89
136
|
}
|
|
90
137
|
|
|
91
138
|
get splitDirection(): SplitDirection {
|
|
@@ -126,7 +173,10 @@ class OpenStreetMapLayer
|
|
|
126
173
|
splitDirection: this.splitDirection,
|
|
127
174
|
minLevel: 0,
|
|
128
175
|
maxLevel: this.maxLevel,
|
|
176
|
+
minRenderingLevel: this.minRenderingLevel,
|
|
177
|
+
maxRenderingLevel: this.maxRenderingLevel,
|
|
129
178
|
tilingSchema: TilingScheme.GEOGRAPHIC,
|
|
179
|
+
imageryLayerOptions: this.imageryLayerOptions,
|
|
130
180
|
};
|
|
131
181
|
}
|
|
132
182
|
|
|
@@ -164,11 +214,23 @@ class OpenStreetMapLayer
|
|
|
164
214
|
config.maxLevel = this.maxLevel;
|
|
165
215
|
}
|
|
166
216
|
|
|
217
|
+
if (this.minRenderingLevel !== defaultOptions.minRenderingLevel) {
|
|
218
|
+
config.minRenderingLevel = this.minRenderingLevel;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (this.maxRenderingLevel !== defaultOptions.maxRenderingLevel) {
|
|
222
|
+
config.maxRenderingLevel = this.maxRenderingLevel;
|
|
223
|
+
}
|
|
224
|
+
|
|
167
225
|
if (this._splitDirection !== SplitDirection.NONE) {
|
|
168
226
|
config.splitDirection =
|
|
169
227
|
this._splitDirection === SplitDirection.RIGHT ? 'right' : 'left';
|
|
170
228
|
}
|
|
171
229
|
|
|
230
|
+
if (this.imageryLayerOptions !== defaultOptions.imageryLayerOptions) {
|
|
231
|
+
config.imageryLayerOptions = structuredClone(this.imageryLayerOptions);
|
|
232
|
+
}
|
|
233
|
+
|
|
172
234
|
return config;
|
|
173
235
|
}
|
|
174
236
|
|
|
@@ -19,6 +19,10 @@ class RasterLayerOpenlayersImpl
|
|
|
19
19
|
|
|
20
20
|
maxLevel: number;
|
|
21
21
|
|
|
22
|
+
minRenderingLevel: number | undefined;
|
|
23
|
+
|
|
24
|
+
maxRenderingLevel: number | undefined;
|
|
25
|
+
|
|
22
26
|
tilingSchema: TilingScheme;
|
|
23
27
|
|
|
24
28
|
extent: Extent;
|
|
@@ -29,6 +33,8 @@ class RasterLayerOpenlayersImpl
|
|
|
29
33
|
super(map, options);
|
|
30
34
|
this.minLevel = options.minLevel;
|
|
31
35
|
this.maxLevel = options.maxLevel;
|
|
36
|
+
this.minRenderingLevel = options.minRenderingLevel;
|
|
37
|
+
this.maxRenderingLevel = options.maxRenderingLevel;
|
|
32
38
|
this.tilingSchema = options.tilingSchema;
|
|
33
39
|
this.extent = options.extent as Extent;
|
|
34
40
|
this.opacity = options.opacity;
|
|
@@ -60,6 +60,8 @@ class TmsOpenlayersImpl extends RasterLayerOpenlayersImpl {
|
|
|
60
60
|
const tileOptions: TileOptions<XYZ> = {
|
|
61
61
|
source: new XYZ(sourceOptions),
|
|
62
62
|
opacity: this.opacity,
|
|
63
|
+
minZoom: this.minRenderingLevel,
|
|
64
|
+
maxZoom: this.maxRenderingLevel,
|
|
63
65
|
};
|
|
64
66
|
if (this.extent && this.extent.isValid()) {
|
|
65
67
|
tileOptions.extent =
|
|
@@ -32,13 +32,6 @@ class VectorTileOpenlayersImpl
|
|
|
32
32
|
|
|
33
33
|
tileSize: Size;
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
* tiles to update on next TileRedraw
|
|
37
|
-
*/
|
|
38
|
-
private _tilesToUpdate: Set<string> = new Set();
|
|
39
|
-
|
|
40
|
-
private _reloadTimeout: number | undefined = undefined;
|
|
41
|
-
|
|
42
35
|
minLevel: number | undefined;
|
|
43
36
|
|
|
44
37
|
maxLevel: number | undefined;
|
|
@@ -107,45 +100,18 @@ class VectorTileOpenlayersImpl
|
|
|
107
100
|
}
|
|
108
101
|
|
|
109
102
|
/**
|
|
110
|
-
*
|
|
111
|
-
* rendering happens async
|
|
103
|
+
* refreshes the openlayers Layer, which will redraw the scene, seems to magically work
|
|
112
104
|
*/
|
|
113
105
|
updateTiles(tileIds: string[]): void {
|
|
114
106
|
if (tileIds.length > 0) {
|
|
115
|
-
|
|
116
|
-
this._tilesToUpdate.add(tileId);
|
|
117
|
-
});
|
|
118
|
-
if (this.source) {
|
|
119
|
-
if (!this._reloadTimeout) {
|
|
120
|
-
this._reloadTimeout = window.setTimeout(() => {
|
|
121
|
-
this._tilesToUpdate.forEach((tileId) => {
|
|
122
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
123
|
-
// @ts-ignore
|
|
124
|
-
const tCache = this.source.tileCache;
|
|
125
|
-
if (tCache.containsKey(tileId)) {
|
|
126
|
-
// change of key of tile (will trigger a reload)
|
|
127
|
-
const tile = tCache.get(tileId) as VectorTile<Feature>;
|
|
128
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
129
|
-
// @ts-ignore
|
|
130
|
-
tile.key = false;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
this.source!.changed();
|
|
134
|
-
this._tilesToUpdate.clear();
|
|
135
|
-
this._reloadTimeout = undefined;
|
|
136
|
-
}, 0);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
107
|
+
this.olLayer?.changed();
|
|
139
108
|
}
|
|
140
109
|
}
|
|
141
110
|
|
|
142
111
|
// eslint-disable-next-line no-unused-vars
|
|
143
112
|
updateStyle(_style: StyleItem, _silent?: boolean): void {
|
|
144
113
|
if (this.initialized) {
|
|
145
|
-
|
|
146
|
-
this._reloadTimeout = undefined;
|
|
147
|
-
this._tilesToUpdate.clear();
|
|
148
|
-
this.source!.refresh();
|
|
114
|
+
this.olLayer?.changed();
|
|
149
115
|
}
|
|
150
116
|
}
|
|
151
117
|
|
|
@@ -46,6 +46,8 @@ class WmsOpenlayersImpl extends RasterLayerOpenlayersImpl {
|
|
|
46
46
|
headers: this.headers,
|
|
47
47
|
}),
|
|
48
48
|
opacity: this.opacity,
|
|
49
|
+
minZoom: this.minRenderingLevel,
|
|
50
|
+
maxZoom: this.maxRenderingLevel,
|
|
49
51
|
});
|
|
50
52
|
}
|
|
51
53
|
return new Tile({
|
|
@@ -62,6 +64,8 @@ class WmsOpenlayersImpl extends RasterLayerOpenlayersImpl {
|
|
|
62
64
|
headers: this.headers,
|
|
63
65
|
}),
|
|
64
66
|
opacity: this.opacity,
|
|
67
|
+
minZoom: this.minRenderingLevel,
|
|
68
|
+
maxZoom: this.maxRenderingLevel,
|
|
65
69
|
});
|
|
66
70
|
}
|
|
67
71
|
}
|
|
@@ -124,6 +124,8 @@ class WmtsOpenlayersImpl extends RasterLayerOpenlayersImpl {
|
|
|
124
124
|
Object.assign(wmtsOptions, this.openlayersOptions);
|
|
125
125
|
return new Tile({
|
|
126
126
|
opacity: this.opacity,
|
|
127
|
+
minZoom: this.minRenderingLevel,
|
|
128
|
+
maxZoom: this.maxRenderingLevel,
|
|
127
129
|
source: new WMTSSource(wmtsOptions),
|
|
128
130
|
});
|
|
129
131
|
}
|