@vcmap/core 5.0.0-rc.0 → 5.0.0-rc.11
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 +7578 -0
- package/index.js +137 -131
- package/package.json +16 -23
- package/src/category/appBackedCategory.js +76 -0
- package/src/category/category.js +401 -0
- package/src/category/categoryCollection.js +145 -0
- package/src/cesium/cesium3DTileFeature.js +1 -1
- package/src/classRegistry.js +162 -0
- package/src/context.js +72 -0
- package/src/{vcs/vcm/util/featureProvider → featureProvider}/abstractFeatureProvider.js +8 -9
- 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 +25 -18
- package/src/{vcs/vcm/interaction → interaction}/abstractInteraction.js +19 -18
- package/src/{vcs/vcm/interaction → interaction}/coordinateAtPixel.js +6 -9
- package/src/{vcs/vcm/interaction → interaction}/eventHandler.js +3 -3
- package/src/{vcs/vcm/interaction → interaction}/featureAtPixelInteraction.js +6 -19
- package/src/{vcs/vcm/interaction → interaction}/featureProviderInteraction.js +2 -13
- 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} +8 -11
- 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} +3 -4
- 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} +38 -37
- package/src/{vcs/vcm/layer/czml.js → layer/czmlLayer.js} +14 -17
- package/src/{vcs/vcm/layer/dataSource.js → layer/dataSourceLayer.js} +13 -14
- package/src/{vcs/vcm/layer → layer}/featureLayer.js +17 -31
- package/src/{vcs/vcm/layer/featureStore.js → layer/featureStoreLayer.js} +53 -54
- package/src/{vcs/vcm/layer/featureStoreChanges.js → layer/featureStoreLayerChanges.js} +98 -82
- package/src/{vcs/vcm/layer/featureStoreState.js → layer/featureStoreLayerState.js} +1 -2
- package/src/{vcs/vcm/layer → layer}/featureVisibility.js +6 -6
- package/src/{vcs/vcm/layer → layer}/geojsonHelpers.js +15 -41
- package/src/{vcs/vcm/layer/geojson.js → layer/geojsonLayer.js} +19 -22
- package/src/{vcs/vcm/layer → layer}/globalHider.js +1 -12
- package/src/{vcs/vcm/layer → layer}/layer.js +11 -12
- 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} +6 -7
- package/src/{vcs/vcm/layer/openStreetMap.js → layer/openStreetMapLayer.js} +32 -33
- 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} +6 -7
- 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} +26 -34
- package/src/{vcs/vcm/layer → layer}/rasterLayer.js +18 -20
- package/src/{vcs/vcm/layer/singleImage.js → layer/singleImageLayer.js} +20 -20
- package/src/{vcs/vcm/layer → layer}/terrainHelpers.js +13 -49
- package/src/{vcs/vcm/layer/terrain.js → layer/terrainLayer.js} +13 -14
- package/src/{vcs/vcm/layer → layer}/tileLoadedHelper.js +5 -5
- package/src/{vcs/vcm/layer → layer}/tileProvider/mvtTileProvider.js +22 -5
- package/src/layer/tileProvider/staticGeojsonTileProvider.js +81 -0
- package/src/{vcs/vcm/layer → layer}/tileProvider/tileProvider.js +16 -8
- package/src/{vcs/vcm/layer → layer}/tileProvider/urlTemplateTileProvider.js +20 -6
- package/src/{vcs/vcm/layer/tms.js → layer/tmsLayer.js} +19 -20
- package/src/{vcs/vcm/layer → layer}/vectorHelpers.js +5 -5
- package/src/{vcs/vcm/layer/vector.js → layer/vectorLayer.js} +38 -48
- 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} +32 -42
- package/src/{vcs/vcm/layer/wfs.js → layer/wfsLayer.js} +19 -20
- package/src/{vcs/vcm/layer → layer}/wmsHelpers.js +1 -1
- package/src/{vcs/vcm/layer/wms.js → layer/wmsLayer.js} +22 -23
- package/src/{vcs/vcm/layer/wmts.js → layer/wmtsLayer.js} +20 -21
- package/src/{vcs/vcm/maps → map}/baseOLMap.js +5 -6
- package/src/{vcs/vcm/maps → map}/cameraLimiter.js +11 -17
- package/src/{vcs/vcm/maps/cesium.js → map/cesiumMap.js} +21 -34
- package/src/{vcs/vcm/maps → map}/mapState.js +0 -1
- package/src/{vcs/vcm/maps/oblique.js → map/obliqueMap.js} +42 -57
- package/src/{vcs/vcm/maps/openlayers.js → map/openlayersMap.js} +17 -15
- package/src/{vcs/vcm/maps/map.js → map/vcsMap.js} +41 -22
- 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 +23 -86
- 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}/dateTime.js +0 -0
- package/src/{vcs/vcm/util → util}/exclusiveManager.js +0 -0
- package/src/{vcs/vcm/util → util}/extent.js +18 -12
- 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 +3 -3
- 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 +16 -12
- package/src/{vcs/vcm/util → util}/locale.js +1 -1
- 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 +39 -29
- 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 +5 -9
- package/src/vcsApp.js +471 -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} +2 -10
- package/tests/data/buildings/tileset.json +428 -0
- package/tests/data/dynamicPointCzml.json +64 -0
- package/tests/data/oblique/imageData/imagev34.json +352 -0
- package/tests/data/oblique/imageData/imagev35.json +54 -0
- package/tests/data/oblique/imageData/imagev35PerImageSize.json +53 -0
- package/tests/data/oblique/tiledImageData/12/2199/1342.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2199/1343.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2199/1344.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2200/1342.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2200/1343.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2200/1344.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2201/1342.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2201/1343.json +1 -0
- package/tests/data/oblique/tiledImageData/12/2201/1344.json +1 -0
- package/tests/data/oblique/tiledImageData/image.json +1 -0
- package/tests/data/terrain/13/8800/6485.terrain +0 -0
- package/tests/data/terrain/13/8800/6486.terrain +0 -0
- package/tests/data/terrain/13/8801/6485.terrain +0 -0
- package/tests/data/terrain/13/8801/6486.terrain +0 -0
- package/tests/data/terrain/layer.json +136 -0
- package/tests/data/testGeoJSON.json +161 -0
- package/tests/data/tile.pbf +0 -0
- package/tests/unit/helpers/cesiumHelpers.js +272 -0
- package/tests/unit/helpers/getFileNameFromUrl.js +12 -0
- package/tests/unit/helpers/helpers.js +11 -0
- package/tests/unit/helpers/imageHelpers.js +20 -0
- package/tests/unit/helpers/importJSON.js +15 -0
- package/tests/unit/helpers/obliqueData.js +76 -0
- package/tests/unit/helpers/obliqueHelpers.js +112 -0
- package/tests/unit/helpers/openlayersHelpers.js +22 -0
- package/tests/unit/helpers/terrain/terrainData.js +46 -0
- package/src/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/featureconverter/extent3d.js +0 -154
- package/src/vcs/vcm/util/style/styleFactory.js +0 -48
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tilejson": "2.1.0",
|
|
3
|
+
"qmc-version": "3.5-0-g0f89f13_64bit_QMC_virtualcitySYSTEMS_GmbH",
|
|
4
|
+
"version": "1.1536156513599457",
|
|
5
|
+
"format": "quantized-mesh-1.0",
|
|
6
|
+
"scheme": "tms",
|
|
7
|
+
"extensions": [
|
|
8
|
+
"octvertexnormals"
|
|
9
|
+
],
|
|
10
|
+
"tiles": [
|
|
11
|
+
"{z}/{x}/{y}.terrain?v={version}"
|
|
12
|
+
],
|
|
13
|
+
"minzoom": 0,
|
|
14
|
+
"maxzoom": 13,
|
|
15
|
+
"bounds": [
|
|
16
|
+
-180.0,
|
|
17
|
+
-90.0,
|
|
18
|
+
180.0,
|
|
19
|
+
90.0
|
|
20
|
+
],
|
|
21
|
+
"projection": "EPSG:4326",
|
|
22
|
+
"available": [
|
|
23
|
+
[
|
|
24
|
+
{
|
|
25
|
+
"endY": 0,
|
|
26
|
+
"endX": 1,
|
|
27
|
+
"startX": 0,
|
|
28
|
+
"startY": 0
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
{
|
|
33
|
+
"endY": 1,
|
|
34
|
+
"endX": 2,
|
|
35
|
+
"startX": 2,
|
|
36
|
+
"startY": 1
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
"endY": 3,
|
|
42
|
+
"endX": 4,
|
|
43
|
+
"startX": 4,
|
|
44
|
+
"startY": 3
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
{
|
|
49
|
+
"endY": 6,
|
|
50
|
+
"endX": 8,
|
|
51
|
+
"startX": 8,
|
|
52
|
+
"startY": 6
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
{
|
|
57
|
+
"endY": 12,
|
|
58
|
+
"endX": 17,
|
|
59
|
+
"startX": 17,
|
|
60
|
+
"startY": 12
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
{
|
|
65
|
+
"endY": 25,
|
|
66
|
+
"endX": 34,
|
|
67
|
+
"startX": 34,
|
|
68
|
+
"startY": 25
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
{
|
|
73
|
+
"endY": 50,
|
|
74
|
+
"endX": 68,
|
|
75
|
+
"startX": 68,
|
|
76
|
+
"startY": 50
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
[
|
|
80
|
+
{
|
|
81
|
+
"endY": 101,
|
|
82
|
+
"endX": 137,
|
|
83
|
+
"startX": 137,
|
|
84
|
+
"startY": 101
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
[
|
|
88
|
+
{
|
|
89
|
+
"endY": 202,
|
|
90
|
+
"endX": 275,
|
|
91
|
+
"startX": 275,
|
|
92
|
+
"startY": 202
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
{
|
|
97
|
+
"endY": 405,
|
|
98
|
+
"endX": 550,
|
|
99
|
+
"startX": 550,
|
|
100
|
+
"startY": 405
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
{
|
|
105
|
+
"endY": 810,
|
|
106
|
+
"endX": 1100,
|
|
107
|
+
"startX": 1100,
|
|
108
|
+
"startY": 810
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
[
|
|
112
|
+
{
|
|
113
|
+
"endY": 1621,
|
|
114
|
+
"endX": 2200,
|
|
115
|
+
"startX": 2200,
|
|
116
|
+
"startY": 1621
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
[
|
|
120
|
+
{
|
|
121
|
+
"endY": 3243,
|
|
122
|
+
"endX": 4400,
|
|
123
|
+
"startX": 4400,
|
|
124
|
+
"startY": 3242
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
[
|
|
128
|
+
{
|
|
129
|
+
"endY": 6486,
|
|
130
|
+
"endX": 8801,
|
|
131
|
+
"startX": 8800,
|
|
132
|
+
"startY": 6485
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
]
|
|
136
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
{
|
|
2
|
+
"geometries": [
|
|
3
|
+
{
|
|
4
|
+
"type": "Point",
|
|
5
|
+
"coordinates": [
|
|
6
|
+
1,
|
|
7
|
+
1,
|
|
8
|
+
1
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "MultiPoint",
|
|
13
|
+
"coordinates": [
|
|
14
|
+
[
|
|
15
|
+
1,
|
|
16
|
+
1,
|
|
17
|
+
1
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
2,
|
|
21
|
+
2,
|
|
22
|
+
2
|
|
23
|
+
]
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "LineString",
|
|
28
|
+
"coordinates": [
|
|
29
|
+
[1, 1, 1],
|
|
30
|
+
[2, 2, 2]
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "MultiLineString",
|
|
35
|
+
"coordinates": [
|
|
36
|
+
[
|
|
37
|
+
[1, 1, 1],
|
|
38
|
+
[2, 2, 2]
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
[3, 3, 3],
|
|
42
|
+
[4, 4, 4]
|
|
43
|
+
]
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "Polygon",
|
|
48
|
+
"coordinates": [
|
|
49
|
+
[
|
|
50
|
+
[0, 0, 0],
|
|
51
|
+
[10, 0, 0],
|
|
52
|
+
[10, 10, 0],
|
|
53
|
+
[0, 10, 0],
|
|
54
|
+
[0, 0, 0]
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
[2, 2, 0],
|
|
58
|
+
[2, 8, 0],
|
|
59
|
+
[8, 8, 0],
|
|
60
|
+
[8, 2, 0],
|
|
61
|
+
[2, 2, 0]
|
|
62
|
+
]
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"type": "MultiPolygon",
|
|
67
|
+
"coordinates": [
|
|
68
|
+
[
|
|
69
|
+
[
|
|
70
|
+
[0, 0, 0],
|
|
71
|
+
[1, 1, 0],
|
|
72
|
+
[0, 1, 0],
|
|
73
|
+
[0, 0, 0]
|
|
74
|
+
]
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
[
|
|
78
|
+
[2, 2, 0],
|
|
79
|
+
[4, 2, 0],
|
|
80
|
+
[4, 4, 0],
|
|
81
|
+
[2, 2, 0]
|
|
82
|
+
]
|
|
83
|
+
]
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"feature": {
|
|
88
|
+
"type": "Feature",
|
|
89
|
+
"id": "test",
|
|
90
|
+
"properties": {
|
|
91
|
+
"foo": 1,
|
|
92
|
+
"bar": "test"
|
|
93
|
+
},
|
|
94
|
+
"geometry": {
|
|
95
|
+
"type": "Point",
|
|
96
|
+
"coordinates": [1, 1, 1]
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"circle": {
|
|
100
|
+
"type": "Feature",
|
|
101
|
+
"radius": 10,
|
|
102
|
+
"properties": {
|
|
103
|
+
"foo": 1,
|
|
104
|
+
"bar": "test"
|
|
105
|
+
},
|
|
106
|
+
"geometry": {
|
|
107
|
+
"type": "Point",
|
|
108
|
+
"coordinates": [1, 1, 1]
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"featureCollection": {
|
|
112
|
+
"type": "FeatureCollection",
|
|
113
|
+
"features": [
|
|
114
|
+
{
|
|
115
|
+
"type": "Feature",
|
|
116
|
+
"properties": {
|
|
117
|
+
"name": "foo"
|
|
118
|
+
},
|
|
119
|
+
"geometry": {
|
|
120
|
+
"type": "Point",
|
|
121
|
+
"coordinates": [1, 1, 1]
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"type": "Feature",
|
|
126
|
+
"radius": 10,
|
|
127
|
+
"properties": {
|
|
128
|
+
"name": "bar"
|
|
129
|
+
},
|
|
130
|
+
"geometry": {
|
|
131
|
+
"type": "Point",
|
|
132
|
+
"coordinates": [1, 1, 1]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
"featureWithStyle": {
|
|
138
|
+
"id": "test",
|
|
139
|
+
"geometry": {
|
|
140
|
+
"type": "Point",
|
|
141
|
+
"coordinates": [1, 1, 1]
|
|
142
|
+
},
|
|
143
|
+
"vcsMeta":{
|
|
144
|
+
"style": {
|
|
145
|
+
"fill": {
|
|
146
|
+
"color": [255, 0, 0, 1]
|
|
147
|
+
},
|
|
148
|
+
"stroke": {
|
|
149
|
+
"color": [255, 0, 0, 1],
|
|
150
|
+
"width": 2
|
|
151
|
+
},
|
|
152
|
+
"image": {
|
|
153
|
+
"src": "test"
|
|
154
|
+
},
|
|
155
|
+
"text": {
|
|
156
|
+
"fill": { "color": [255, 0, 0, 1] }
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BoundingSphere,
|
|
3
|
+
Entity,
|
|
4
|
+
Camera,
|
|
5
|
+
WebMercatorProjection,
|
|
6
|
+
PrimitiveCollection,
|
|
7
|
+
Globe,
|
|
8
|
+
Event as CesiumEvent,
|
|
9
|
+
SceneMode,
|
|
10
|
+
ImageryLayerCollection,
|
|
11
|
+
Clock,
|
|
12
|
+
DataSourceCollection,
|
|
13
|
+
ScreenSpaceEventHandler,
|
|
14
|
+
Color,
|
|
15
|
+
Cesium3DTileFeature,
|
|
16
|
+
} from '@vcmap/cesium';
|
|
17
|
+
import TweenCollection from '@vcmap/cesium/Source/Scene/TweenCollection.js';
|
|
18
|
+
import ContextLimits from '@vcmap/cesium/Source/Renderer/ContextLimits.js';
|
|
19
|
+
|
|
20
|
+
import CesiumTilesetLayer from '../../../src/layer/cesiumTilesetLayer.js';
|
|
21
|
+
import DataSourceLayer from '../../../src/layer/dataSourceLayer.js';
|
|
22
|
+
import CesiumMap from '../../../src/map/cesiumMap.js';
|
|
23
|
+
import importJSON from './importJSON.js';
|
|
24
|
+
|
|
25
|
+
const defaultTileset = await importJSON('./tests/data/buildings/tileset.json');
|
|
26
|
+
defaultTileset.root.children = [];
|
|
27
|
+
defaultTileset.properties = {};
|
|
28
|
+
|
|
29
|
+
export const tilesetJSON = defaultTileset;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @param {Sinon.SinonSandbox} sandbox
|
|
33
|
+
* @param {string=} url
|
|
34
|
+
* @returns {*|Sinon.SinonFakeServer|null}
|
|
35
|
+
*/
|
|
36
|
+
export function createTilesetServer(sandbox, url) {
|
|
37
|
+
const server = sandbox ? sandbox.useFakeServer() : sinon.createFakeServer();
|
|
38
|
+
server.autoRespond = true;
|
|
39
|
+
server.respondImmediately = true;
|
|
40
|
+
server.respondWith(
|
|
41
|
+
url || 'http://test.com/tileset.json',
|
|
42
|
+
[200, { 'Content-Type': 'application/json' }, JSON.stringify(tilesetJSON)],
|
|
43
|
+
);
|
|
44
|
+
server.respond();
|
|
45
|
+
return server;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @param {Sinon.SinonSandbox} sandbox
|
|
50
|
+
* @param {CesiumMap=} cesiumMap
|
|
51
|
+
* @param {string=} name
|
|
52
|
+
* @returns {Promise<CesiumTilesetLayer>}
|
|
53
|
+
*/
|
|
54
|
+
export async function createInitializedTilesetLayer(sandbox, cesiumMap, name) {
|
|
55
|
+
createTilesetServer(sandbox);
|
|
56
|
+
const tilesetLayer = new CesiumTilesetLayer({
|
|
57
|
+
url: 'http://test.com/tileset.json',
|
|
58
|
+
name,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
await tilesetLayer.initialize();
|
|
62
|
+
if (cesiumMap) {
|
|
63
|
+
cesiumMap.layerCollection.add(tilesetLayer);
|
|
64
|
+
const impls = tilesetLayer.getImplementationsForMap(cesiumMap);
|
|
65
|
+
await Promise.all(impls.map(async (impl) => {
|
|
66
|
+
await impl.initialize();
|
|
67
|
+
Object.defineProperty(impl.cesium3DTileset, 'boundingSphere', {
|
|
68
|
+
get() {
|
|
69
|
+
return new BoundingSphere();
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return tilesetLayer;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function createEntities(numberOfEntities = 1) {
|
|
79
|
+
const layer = new DataSourceLayer({});
|
|
80
|
+
|
|
81
|
+
const entities = new Array(numberOfEntities);
|
|
82
|
+
for (let i = 0; i < numberOfEntities; i++) {
|
|
83
|
+
entities[i] = new Entity({
|
|
84
|
+
model: {},
|
|
85
|
+
});
|
|
86
|
+
layer.addEntity(entities[i]);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
layer,
|
|
91
|
+
entities,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @param {sinon.sandbox} sandbox
|
|
97
|
+
* @param {Cesium/Event} event
|
|
98
|
+
* @returns {sinon.spy}
|
|
99
|
+
*/
|
|
100
|
+
export function getCesiumEventSpy(sandbox, event) {
|
|
101
|
+
const spy = sandbox.spy();
|
|
102
|
+
const listener = event.addEventListener(function callback() {
|
|
103
|
+
listener();
|
|
104
|
+
// eslint-disable-next-line prefer-rest-params
|
|
105
|
+
spy(...arguments);
|
|
106
|
+
});
|
|
107
|
+
return spy;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function getMockScene() {
|
|
111
|
+
const scene = {
|
|
112
|
+
screenSpaceCameraController: {
|
|
113
|
+
enableInputs: true,
|
|
114
|
+
},
|
|
115
|
+
globe: new Globe(),
|
|
116
|
+
mode: SceneMode.SCENE3D,
|
|
117
|
+
tweens: new TweenCollection(),
|
|
118
|
+
primitives: new PrimitiveCollection(),
|
|
119
|
+
groundPrimitives: new PrimitiveCollection(),
|
|
120
|
+
imageryLayers: new ImageryLayerCollection(),
|
|
121
|
+
drawingBufferHeight: 100,
|
|
122
|
+
drawingBufferWidth: 100,
|
|
123
|
+
postRender: new CesiumEvent(),
|
|
124
|
+
preUpdate: new CesiumEvent(),
|
|
125
|
+
mapProjection: new WebMercatorProjection(),
|
|
126
|
+
shadowMap: { enabled: false },
|
|
127
|
+
canvas: document.createElement('canvas'),
|
|
128
|
+
terrainProvider: {
|
|
129
|
+
readyPromise: Promise.resolve(),
|
|
130
|
+
},
|
|
131
|
+
frameState: {
|
|
132
|
+
mode: undefined,
|
|
133
|
+
context: {
|
|
134
|
+
depthTexture: true,
|
|
135
|
+
stencilBuffer: true,
|
|
136
|
+
},
|
|
137
|
+
lineWidth: 1,
|
|
138
|
+
},
|
|
139
|
+
context: {
|
|
140
|
+
depthTexture: true,
|
|
141
|
+
stencilBuffer: true,
|
|
142
|
+
},
|
|
143
|
+
render() {},
|
|
144
|
+
pick() {},
|
|
145
|
+
pickPosition() {},
|
|
146
|
+
destroy() {
|
|
147
|
+
this.primitives.destroy();
|
|
148
|
+
this.groundPrimitives.destroy();
|
|
149
|
+
this.imageryLayers.destroy();
|
|
150
|
+
this.globe.destroy();
|
|
151
|
+
this.canvas = null;
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
const camera = new Camera(scene);
|
|
155
|
+
const originalFlyTo = camera.flyTo;
|
|
156
|
+
|
|
157
|
+
camera.flyTo = function flyTo(options) {
|
|
158
|
+
options.duration = 0;
|
|
159
|
+
originalFlyTo.bind(camera)(options);
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
scene.camera = camera;
|
|
163
|
+
return scene;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function getCesiumMap(mapOptions) {
|
|
167
|
+
const map = new CesiumMap(mapOptions || {});
|
|
168
|
+
const scene = getMockScene();
|
|
169
|
+
map._cesiumWidget = {
|
|
170
|
+
scene,
|
|
171
|
+
camera: scene.camera,
|
|
172
|
+
render: scene.render,
|
|
173
|
+
resolutionScale: 1,
|
|
174
|
+
clock: new Clock({}),
|
|
175
|
+
destroy() {
|
|
176
|
+
this.scene.destroy();
|
|
177
|
+
this.scene = null;
|
|
178
|
+
this.camera = null;
|
|
179
|
+
},
|
|
180
|
+
resize() {},
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
map.screenSpaceEventHandler = new ScreenSpaceEventHandler(map._cesiumWidget.scene.canvas);
|
|
184
|
+
map.dataSourceDisplay = {
|
|
185
|
+
dataSources: new DataSourceCollection(),
|
|
186
|
+
isDestroyed() {
|
|
187
|
+
return false;
|
|
188
|
+
},
|
|
189
|
+
destroy() {
|
|
190
|
+
this.dataSources.destroy();
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
map.initialized = true;
|
|
194
|
+
|
|
195
|
+
return map;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* @param {VcsApp} app
|
|
200
|
+
* @returns {Promise<CesiumMap>}
|
|
201
|
+
*/
|
|
202
|
+
export async function setCesiumMap(app) {
|
|
203
|
+
const map = getCesiumMap({ layerCollection: app.layers, target: app.maps.target });
|
|
204
|
+
app.maps.add(map);
|
|
205
|
+
await app.maps.setActiveMap(map.name);
|
|
206
|
+
return map;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* creates usable default ContextLimits, copy pasted from chrome
|
|
211
|
+
*/
|
|
212
|
+
export function setupCesiumContextLimits() {
|
|
213
|
+
ContextLimits._highpFloatSupported = true;
|
|
214
|
+
ContextLimits._highpIntSupported = true;
|
|
215
|
+
ContextLimits._maximumAliasedLineWidth = 1;
|
|
216
|
+
ContextLimits._maximumAliasedPointSize = 1024;
|
|
217
|
+
ContextLimits._maximumColorAttachments = 8;
|
|
218
|
+
ContextLimits._maximumCombinedTextureImageUnits = 32;
|
|
219
|
+
ContextLimits._maximumCubeMapSize = 16384;
|
|
220
|
+
ContextLimits._maximumDrawBuffers = 8;
|
|
221
|
+
ContextLimits._maximumFragmentUniformVectors = 1024;
|
|
222
|
+
ContextLimits._maximumRenderbufferSize = 16384;
|
|
223
|
+
ContextLimits._maximumTextureFilterAnisotropy = 16;
|
|
224
|
+
ContextLimits._maximumTextureImageUnits = 16;
|
|
225
|
+
ContextLimits._maximumTextureSize = 16384;
|
|
226
|
+
ContextLimits._maximumVaryingVectors = 30;
|
|
227
|
+
ContextLimits._maximumVertexAttributes = 16;
|
|
228
|
+
ContextLimits._maximumVertexTextureImageUnits = 16;
|
|
229
|
+
ContextLimits._maximumVertexUniformVectors = 4095;
|
|
230
|
+
ContextLimits._maximumViewportHeight = 32767;
|
|
231
|
+
ContextLimits._maximumViewportWidth = 32767;
|
|
232
|
+
ContextLimits._minimumAliasedLineWidth = 1;
|
|
233
|
+
ContextLimits._minimumAliasedPointSize = 1;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
class BatchTable {
|
|
237
|
+
constructor(properties) {
|
|
238
|
+
this.properties = properties;
|
|
239
|
+
this.color = new Color();
|
|
240
|
+
this.show = true;
|
|
241
|
+
this.destroyed = false;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
getPropertyNames() { return Object.keys(this.properties); }
|
|
245
|
+
|
|
246
|
+
getProperty(id, prop) { return this.properties[prop]; }
|
|
247
|
+
|
|
248
|
+
getColor() { return this.color; }
|
|
249
|
+
|
|
250
|
+
setColor(id, color) { this.color = color; }
|
|
251
|
+
|
|
252
|
+
getShow() { return this.show; }
|
|
253
|
+
|
|
254
|
+
setShow(id, show) { this.show = show; }
|
|
255
|
+
|
|
256
|
+
isDestroyed() { return this.destroyed; }
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @param {Object} properties
|
|
261
|
+
* @param {Object=} tileset
|
|
262
|
+
* @returns {Cesium.Cesium3DTileFeature}
|
|
263
|
+
*/
|
|
264
|
+
export function createDummyCesium3DTileFeature(properties = {}, tileset) {
|
|
265
|
+
const dummy = new Cesium3DTileFeature();
|
|
266
|
+
const content = { batchTable: new BatchTable(properties), isDestroyed() { return false; } };
|
|
267
|
+
if (tileset) {
|
|
268
|
+
content.tileset = tileset;
|
|
269
|
+
}
|
|
270
|
+
dummy._content = content;
|
|
271
|
+
return dummy;
|
|
272
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @param {string} url
|
|
6
|
+
* @param {string} fileName
|
|
7
|
+
* @returns {string}
|
|
8
|
+
*/
|
|
9
|
+
export default function getFileNameFromUrl(url, fileName) {
|
|
10
|
+
const dirName = fileURLToPath(url);
|
|
11
|
+
return path.join(dirName, fileName);
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* helper function to wait for a timeout use: await timeout(1);
|
|
3
|
+
* @param {number} ms
|
|
4
|
+
* @returns {Promise<void>}
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
7
|
+
export function timeout(ms) {
|
|
8
|
+
return new Promise((resolve) => {
|
|
9
|
+
setTimeout(resolve, ms);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* black Pixel dataURI
|
|
3
|
+
* @type {string}
|
|
4
|
+
*/
|
|
5
|
+
export const blackPixelURI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQYV2NgYGD4DwABBAEAcCBlCwAAAABJRU5ErkJggg==';
|
|
6
|
+
/**
|
|
7
|
+
* green Pixel dataURI
|
|
8
|
+
* @type {string}
|
|
9
|
+
*/
|
|
10
|
+
export const greenPixelURI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQYV2Ng+M/wHwAEAQH/Xi7hpQAAAABJRU5ErkJggg==';
|
|
11
|
+
/**
|
|
12
|
+
* red Pixel dataURI
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
export const redPixelURI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQYV2P4z8DwHwAFAAH/plybXQAAAABJRU5ErkJggg==';
|
|
16
|
+
/**
|
|
17
|
+
* blue Pixel dataURI
|
|
18
|
+
* @type {string}
|
|
19
|
+
*/
|
|
20
|
+
export const bluePixelURI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQYV2NgYPj/HwADAgH/ybKt7gAAAABJRU5ErkJggg==';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param {string} fileName
|
|
5
|
+
* @returns {Promise<Object>}
|
|
6
|
+
*/
|
|
7
|
+
export default async function importJSON(fileName) {
|
|
8
|
+
if (fs.existsSync(fileName)) {
|
|
9
|
+
const content = await fs.promises.readFile(fileName);
|
|
10
|
+
return JSON.parse(content.toString());
|
|
11
|
+
}
|
|
12
|
+
// eslint-disable-next-line no-console
|
|
13
|
+
console.log(`${fileName} does not exist`);
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
import nock from 'nock';
|
|
3
|
+
import importJSON from './importJSON.js';
|
|
4
|
+
|
|
5
|
+
const t2199_1342 = await importJSON('./tests/data/oblique/tiledImageData/12/2199/1342.json');
|
|
6
|
+
const t2199_1343 = await importJSON('./tests/data/oblique/tiledImageData/12/2199/1343.json');
|
|
7
|
+
const t2199_1344 = await importJSON('./tests/data/oblique/tiledImageData/12/2199/1344.json');
|
|
8
|
+
const t2200_1342 = await importJSON('./tests/data/oblique/tiledImageData/12/2200/1342.json');
|
|
9
|
+
const t2200_1343 = await importJSON('./tests/data/oblique/tiledImageData/12/2200/1343.json');
|
|
10
|
+
const t2200_1344 = await importJSON('./tests/data/oblique/tiledImageData/12/2200/1344.json');
|
|
11
|
+
const t2201_1342 = await importJSON('./tests/data/oblique/tiledImageData/12/2201/1342.json');
|
|
12
|
+
const t2201_1343 = await importJSON('./tests/data/oblique/tiledImageData/12/2201/1343.json');
|
|
13
|
+
const t2201_1344 = await importJSON('./tests/data/oblique/tiledImageData/12/2201/1344.json');
|
|
14
|
+
const imageJsonTiled = await importJSON('./tests/data/oblique/tiledImageData/image.json');
|
|
15
|
+
|
|
16
|
+
const tiledImageData = {
|
|
17
|
+
12: {
|
|
18
|
+
2199: {
|
|
19
|
+
1342: t2199_1342,
|
|
20
|
+
1343: t2199_1343,
|
|
21
|
+
1344: t2199_1344,
|
|
22
|
+
},
|
|
23
|
+
2200: {
|
|
24
|
+
1342: t2200_1342,
|
|
25
|
+
1343: t2200_1343,
|
|
26
|
+
1344: t2200_1344,
|
|
27
|
+
},
|
|
28
|
+
2201: {
|
|
29
|
+
1342: t2201_1342,
|
|
30
|
+
1343: t2201_1343,
|
|
31
|
+
1344: t2201_1344,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Center point of first image in 12/2200/1342
|
|
38
|
+
* @type {import("ol/coordinate").Coordinate}
|
|
39
|
+
*/
|
|
40
|
+
export const tiledMercatorCoordinate = [1487752.4290728183, 6888473.584735272, 0];
|
|
41
|
+
/**
|
|
42
|
+
* Center point of first image in 12/2199/1342
|
|
43
|
+
* @type {import("ol/coordinate").Coordinate}
|
|
44
|
+
*/
|
|
45
|
+
export const tiledMercatorCoordinate2 = [1477722.079812214, 6897970.75026968, 0];
|
|
46
|
+
/**
|
|
47
|
+
* Center point of first image
|
|
48
|
+
* @type {import("ol/coordinate").Coordinate}
|
|
49
|
+
*/
|
|
50
|
+
export const imagev35MercatorCoordinate = [1488644.796500772, 6892246.018669462, 0];
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* serves http://localhost/tiledOblique/image.json
|
|
54
|
+
* @param {import("nock").Scope=} optScope
|
|
55
|
+
* @returns {import("nock").Scope} scope
|
|
56
|
+
*/
|
|
57
|
+
export default function getTiledObliqueImageServer(optScope) {
|
|
58
|
+
return (optScope || nock('http://localhost'))
|
|
59
|
+
.persist()
|
|
60
|
+
.get('/tiledOblique/image.json')
|
|
61
|
+
.reply(
|
|
62
|
+
200,
|
|
63
|
+
JSON.stringify(imageJsonTiled),
|
|
64
|
+
// zlib.gzipSync(Buffer.from(JSON.stringify(imageJsonTiled))),
|
|
65
|
+
{ 'Content-Type': 'application/json' },
|
|
66
|
+
)
|
|
67
|
+
.get(/tiledOblique\/12\/(\d{4})\/(\d{4})\.json/)
|
|
68
|
+
.reply((uri) => {
|
|
69
|
+
const [x, y] = uri.match(/(\d{4})/g);
|
|
70
|
+
return [
|
|
71
|
+
200,
|
|
72
|
+
JSON.stringify(tiledImageData['12'][x][y]),
|
|
73
|
+
{ 'Content-Type': 'application/json' },
|
|
74
|
+
];
|
|
75
|
+
});
|
|
76
|
+
}
|