@vcmap/core 5.0.0-rc.33 → 5.0.0-rc.35
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/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js +1 -1
- package/dist/tests/unit/helpers/cesiumHelpers.d.ts +108 -0
- package/dist/tests/unit/helpers/cesiumHelpers.js +277 -0
- package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -0
- package/dist/tests/unit/helpers/getFileNameFromUrl.d.ts +6 -0
- package/{tests → dist/tests}/unit/helpers/getFileNameFromUrl.js +3 -3
- package/dist/tests/unit/helpers/getFileNameFromUrl.js.map +1 -0
- package/dist/tests/unit/helpers/helpers.d.ts +12 -0
- package/{tests → dist/tests}/unit/helpers/helpers.js +8 -17
- package/dist/tests/unit/helpers/helpers.js.map +1 -0
- package/dist/tests/unit/helpers/imageHelpers.d.ts +20 -0
- package/dist/tests/unit/helpers/imageHelpers.js +21 -0
- package/dist/tests/unit/helpers/imageHelpers.js.map +1 -0
- package/dist/tests/unit/helpers/importJSON.d.ts +5 -0
- package/dist/tests/unit/helpers/importJSON.js +15 -0
- package/dist/tests/unit/helpers/importJSON.js.map +1 -0
- package/dist/tests/unit/helpers/obliqueData.d.ts +21 -0
- package/dist/tests/unit/helpers/obliqueData.js +76 -0
- package/dist/tests/unit/helpers/obliqueData.js.map +1 -0
- package/dist/tests/unit/helpers/obliqueHelpers.d.ts +33 -0
- package/{tests → dist/tests}/unit/helpers/obliqueHelpers.js +45 -63
- package/dist/tests/unit/helpers/obliqueHelpers.js.map +1 -0
- package/dist/tests/unit/helpers/openlayersHelpers.d.ts +11 -0
- package/dist/tests/unit/helpers/openlayersHelpers.js +24 -0
- package/dist/tests/unit/helpers/openlayersHelpers.js.map +1 -0
- package/dist/tests/unit/helpers/terrain/terrainData.d.ts +10 -0
- package/dist/tests/unit/helpers/terrain/terrainData.js +40 -0
- package/dist/tests/unit/helpers/terrain/terrainData.js.map +1 -0
- package/package.json +6 -8
- package/src/layer/cesium/vectorRasterTileCesiumImpl.ts +1 -1
- package/tests/unit/helpers/cesiumHelpers.js +0 -326
- package/tests/unit/helpers/imageHelpers.js +0 -24
- package/tests/unit/helpers/importJSON.js +0 -15
- package/tests/unit/helpers/obliqueData.js +0 -102
- package/tests/unit/helpers/openlayersHelpers.js +0 -25
- package/tests/unit/helpers/terrain/terrainData.js +0 -45
- /package/{tests → dist/tests}/data/dynamicPointCzml.json +0 -0
- /package/{tests → dist/tests}/data/oblique/imageData/imagev34.json +0 -0
- /package/{tests → dist/tests}/data/oblique/imageData/imagev35.json +0 -0
- /package/{tests → dist/tests}/data/oblique/imageData/imagev35PerImageSize.json +0 -0
- /package/{tests → dist/tests}/data/oblique/tiledImageData/12/2199/1342.json +0 -0
- /package/{tests → dist/tests}/data/oblique/tiledImageData/12/2199/1343.json +0 -0
- /package/{tests → dist/tests}/data/oblique/tiledImageData/12/2199/1344.json +0 -0
- /package/{tests → dist/tests}/data/oblique/tiledImageData/12/2200/1342.json +0 -0
- /package/{tests → dist/tests}/data/oblique/tiledImageData/12/2200/1343.json +0 -0
- /package/{tests → dist/tests}/data/oblique/tiledImageData/12/2200/1344.json +0 -0
- /package/{tests → dist/tests}/data/oblique/tiledImageData/12/2201/1342.json +0 -0
- /package/{tests → dist/tests}/data/oblique/tiledImageData/12/2201/1343.json +0 -0
- /package/{tests → dist/tests}/data/oblique/tiledImageData/12/2201/1344.json +0 -0
- /package/{tests → dist/tests}/data/oblique/tiledImageData/image.json +0 -0
- /package/{tests → dist/tests}/data/terrain/13/8800/6485.terrain +0 -0
- /package/{tests → dist/tests}/data/terrain/13/8800/6486.terrain +0 -0
- /package/{tests → dist/tests}/data/terrain/13/8801/6485.terrain +0 -0
- /package/{tests → dist/tests}/data/terrain/13/8801/6486.terrain +0 -0
- /package/{tests → dist/tests}/data/terrain/layer.json +0 -0
- /package/{tests → dist/tests}/data/testGeoJSON.json +0 -0
- /package/{tests → dist/tests}/data/tile.pbf +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"obliqueData.js","sourceRoot":"","sources":["../../../../tests/unit/helpers/obliqueData.js"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,MAAM,UAAU,GAAG,MAAM,UAAU,CACjC,uDAAuD,CACxD,CAAC;AACF,MAAM,UAAU,GAAG,MAAM,UAAU,CACjC,uDAAuD,CACxD,CAAC;AACF,MAAM,UAAU,GAAG,MAAM,UAAU,CACjC,uDAAuD,CACxD,CAAC;AACF,MAAM,UAAU,GAAG,MAAM,UAAU,CACjC,uDAAuD,CACxD,CAAC;AACF,MAAM,UAAU,GAAG,MAAM,UAAU,CACjC,uDAAuD,CACxD,CAAC;AACF,MAAM,UAAU,GAAG,MAAM,UAAU,CACjC,uDAAuD,CACxD,CAAC;AACF,MAAM,UAAU,GAAG,MAAM,UAAU,CACjC,uDAAuD,CACxD,CAAC;AACF,MAAM,UAAU,GAAG,MAAM,UAAU,CACjC,uDAAuD,CACxD,CAAC;AACF,MAAM,UAAU,GAAG,MAAM,UAAU,CACjC,uDAAuD,CACxD,CAAC;AACF,MAAM,cAAc,GAAG,MAAM,UAAU,CACrC,gDAAgD,CACjD,CAAC;AAEF,MAAM,cAAc,GAAG;IACrB,EAAE,EAAE;QACF,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,UAAU;SACjB;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,UAAU;SACjB;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,UAAU;SACjB;KACF;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACzC,CAAC;AACF;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CACvC,CAAC;AACF;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,iBAAiB,EAAE,iBAAiB,EAAE,CAAC;CACxC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,QAAQ;IACzD,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC;SAC1C,OAAO,EAAE;SACT,GAAG,CAAC,0BAA0B,CAAC;SAC/B,KAAK,CACJ,GAAG,EACH,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;IAC9B,8DAA8D;IAC9D,EAAE,cAAc,EAAE,kBAAkB,EAAE,CACvC;SACA,GAAG,CAAC,0CAA0C,CAAC;SAC/C,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACb,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACrC,OAAO;YACL,GAAG;YACH,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1C,EAAE,cAAc,EAAE,kBAAkB,EAAE;SACvC,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* returns an oblique Dataset
|
|
3
|
+
* @param {Scope=} scope if provided the dataset is initialized with a terrainProvider
|
|
4
|
+
* @returns {vcs-oblique/ObliqueDataSet}
|
|
5
|
+
*/
|
|
6
|
+
export function getObliqueDataSet(scope?: Scope | undefined): vcs;
|
|
7
|
+
/**
|
|
8
|
+
* @param {Array<ObliqueDataSet>=} obliqueDataSets
|
|
9
|
+
* @returns {ObliqueCollection}
|
|
10
|
+
*/
|
|
11
|
+
export function getObliqueCollection(obliqueDataSets?: Array<ObliqueDataSet> | undefined): ObliqueCollection;
|
|
12
|
+
/**
|
|
13
|
+
* @param {ObliqueOptions} [mapOptions={}]
|
|
14
|
+
* @param {Scope=} scope optional server, if provided the map will be initialized with a terrainProvider
|
|
15
|
+
* @returns {Promise<ObliqueMap>}
|
|
16
|
+
*/
|
|
17
|
+
export function getObliqueMap(mapOptions?: any, scope?: Scope | undefined): Promise<ObliqueMap>;
|
|
18
|
+
/**
|
|
19
|
+
* @param {VcsApp} app
|
|
20
|
+
* @param {Scope=} scope optional server, if provided the map will be initialized with a terrainProvider
|
|
21
|
+
* @param {Viewpoint=} startingVP
|
|
22
|
+
* @returns {Promise<ObliqueMap>}
|
|
23
|
+
*/
|
|
24
|
+
export function setObliqueMap(app: VcsApp, scope?: Scope | undefined, startingVP?: Viewpoint | undefined): Promise<ObliqueMap>;
|
|
25
|
+
/**
|
|
26
|
+
* Center point of first image
|
|
27
|
+
* @type {import("ol/coordinate").Coordinate}
|
|
28
|
+
*/
|
|
29
|
+
export const mercatorCoordinates: any;
|
|
30
|
+
import ObliqueDataSet from '../../../src/oblique/obliqueDataSet.js';
|
|
31
|
+
import ObliqueCollection from '../../../src/oblique/obliqueCollection.js';
|
|
32
|
+
import ObliqueMap from '../../../src/map/obliqueMap.js';
|
|
33
|
+
import Viewpoint from '../../../src/util/viewpoint.js';
|
|
@@ -1,102 +1,86 @@
|
|
|
1
1
|
import Projection from '../../../src/util/projection.js';
|
|
2
2
|
import ObliqueMap from '../../../src/map/obliqueMap.js';
|
|
3
3
|
import Viewpoint from '../../../src/util/viewpoint.js';
|
|
4
|
-
|
|
5
4
|
import { getTerrainProvider } from './terrain/terrainData.js';
|
|
6
5
|
import ObliqueCollection from '../../../src/oblique/obliqueCollection.js';
|
|
7
6
|
import ObliqueDataSet from '../../../src/oblique/obliqueDataSet.js';
|
|
8
7
|
import importJSON from './importJSON.js';
|
|
9
8
|
import getFileNameFromUrl from './getFileNameFromUrl.js';
|
|
10
|
-
|
|
11
|
-
const fileName = getFileNameFromUrl(
|
|
12
|
-
import.meta.url,
|
|
13
|
-
'../../../data/oblique/imageData/imagev35.json',
|
|
14
|
-
);
|
|
9
|
+
const fileName = getFileNameFromUrl(import.meta.url, '../../../data/oblique/imageData/imagev35.json');
|
|
15
10
|
const imageJson = await importJSON(fileName);
|
|
16
|
-
|
|
17
11
|
/**
|
|
18
12
|
* Center point of first image
|
|
19
13
|
* @type {import("ol/coordinate").Coordinate}
|
|
20
14
|
*/
|
|
21
15
|
export const mercatorCoordinates = [1488644.796500772, 6892246.018669462, 0];
|
|
22
|
-
|
|
23
16
|
/**
|
|
24
17
|
* cached oblique Projection
|
|
25
18
|
* @type {Projection}
|
|
26
19
|
*/
|
|
27
20
|
let obliqueProjection = null;
|
|
28
|
-
|
|
29
21
|
/**
|
|
30
22
|
* @returns {Viewpoint}
|
|
31
23
|
*/
|
|
32
24
|
function getStartingViewpoint() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
25
|
+
return new Viewpoint({
|
|
26
|
+
name: '5b609a0d-28a1-4f4e-ba6c-29f2592fa889',
|
|
27
|
+
distance: 264.6285087486175,
|
|
28
|
+
cameraPosition: null,
|
|
29
|
+
groundPosition: [13.41528061371218, 52.50232648590358],
|
|
30
|
+
heading: 0,
|
|
31
|
+
pitch: -90,
|
|
32
|
+
roll: 0,
|
|
33
|
+
animate: false,
|
|
34
|
+
});
|
|
43
35
|
}
|
|
44
|
-
|
|
45
36
|
/**
|
|
46
37
|
* returns an oblique Dataset
|
|
47
38
|
* @param {Scope=} scope if provided the dataset is initialized with a terrainProvider
|
|
48
39
|
* @returns {vcs-oblique/ObliqueDataSet}
|
|
49
40
|
*/
|
|
50
41
|
export async function getObliqueDataSet(scope) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
terrainProvider,
|
|
68
|
-
);
|
|
69
|
-
await obliqueDataSet.initialize(imageJson);
|
|
70
|
-
return obliqueDataSet;
|
|
42
|
+
if (!obliqueProjection) {
|
|
43
|
+
obliqueProjection = new Projection({
|
|
44
|
+
epsg: 'EPSG:25833',
|
|
45
|
+
proj4: '+proj=utm +zone=33 +ellps=GRS80 +units=m +no_defs',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
let terrainProvider;
|
|
49
|
+
if (scope) {
|
|
50
|
+
await getTerrainProvider(scope);
|
|
51
|
+
terrainProvider = {
|
|
52
|
+
url: 'http://localhost/terrain/',
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const obliqueDataSet = new ObliqueDataSet('http://localhost/', obliqueProjection, terrainProvider);
|
|
56
|
+
await obliqueDataSet.initialize(imageJson);
|
|
57
|
+
return obliqueDataSet;
|
|
71
58
|
}
|
|
72
|
-
|
|
73
59
|
/**
|
|
74
60
|
* @param {Array<ObliqueDataSet>=} obliqueDataSets
|
|
75
61
|
* @returns {ObliqueCollection}
|
|
76
62
|
*/
|
|
77
63
|
export async function getObliqueCollection(obliqueDataSets) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
64
|
+
const dataSets = obliqueDataSets || [await getObliqueDataSet()];
|
|
65
|
+
const obliqueCollection = new ObliqueCollection({
|
|
66
|
+
name: 'obliqueCollection',
|
|
67
|
+
dataSets,
|
|
68
|
+
});
|
|
69
|
+
return obliqueCollection;
|
|
84
70
|
}
|
|
85
|
-
|
|
86
71
|
/**
|
|
87
72
|
* @param {ObliqueOptions} [mapOptions={}]
|
|
88
73
|
* @param {Scope=} scope optional server, if provided the map will be initialized with a terrainProvider
|
|
89
74
|
* @returns {Promise<ObliqueMap>}
|
|
90
75
|
*/
|
|
91
76
|
export async function getObliqueMap(mapOptions = {}, scope = undefined) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
77
|
+
const obliqueDataSet = await getObliqueDataSet(scope);
|
|
78
|
+
const obliqueCollection = await getObliqueCollection([obliqueDataSet]);
|
|
79
|
+
const map = new ObliqueMap(mapOptions);
|
|
80
|
+
await map.initialize();
|
|
81
|
+
await map.setCollection(obliqueCollection);
|
|
82
|
+
return map;
|
|
98
83
|
}
|
|
99
|
-
|
|
100
84
|
/**
|
|
101
85
|
* @param {VcsApp} app
|
|
102
86
|
* @param {Scope=} scope optional server, if provided the map will be initialized with a terrainProvider
|
|
@@ -104,12 +88,10 @@ export async function getObliqueMap(mapOptions = {}, scope = undefined) {
|
|
|
104
88
|
* @returns {Promise<ObliqueMap>}
|
|
105
89
|
*/
|
|
106
90
|
export async function setObliqueMap(app, scope, startingVP) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
await app.maps.setActiveMap(map.name);
|
|
113
|
-
await map.gotoViewpoint(startingVP || getStartingViewpoint());
|
|
114
|
-
return map;
|
|
91
|
+
const map = await getObliqueMap({ layerCollection: app.layers, target: app.maps.target }, scope);
|
|
92
|
+
app.maps.add(map);
|
|
93
|
+
await app.maps.setActiveMap(map.name);
|
|
94
|
+
await map.gotoViewpoint(startingVP || getStartingViewpoint());
|
|
95
|
+
return map;
|
|
115
96
|
}
|
|
97
|
+
//# sourceMappingURL=obliqueHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"obliqueHelpers.js","sourceRoot":"","sources":["../../../../tests/unit/helpers/obliqueHelpers.js"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,iCA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CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClB,MAAM,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,GAAG,CAAC,aAAa,CAAC,UAAU,IAAI,oBAAoB,EAAE,CAAC,CAAC;IAC9D,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {OpenlayersOptions=} mapOptions
|
|
3
|
+
* @returns {Promise<OpenlayersMap>}
|
|
4
|
+
*/
|
|
5
|
+
export function getOpenlayersMap(mapOptions?: OpenlayersOptions | undefined): Promise<OpenlayersMap>;
|
|
6
|
+
/**
|
|
7
|
+
* @param {VcsApp} app
|
|
8
|
+
* @returns {Promise<OpenlayersMap>}
|
|
9
|
+
*/
|
|
10
|
+
export function setOpenlayersMap(app: VcsApp): Promise<OpenlayersMap>;
|
|
11
|
+
import OpenlayersMap from '../../../src/map/openlayersMap.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import OpenlayersMap from '../../../src/map/openlayersMap.js';
|
|
2
|
+
/**
|
|
3
|
+
* @param {OpenlayersOptions=} mapOptions
|
|
4
|
+
* @returns {Promise<OpenlayersMap>}
|
|
5
|
+
*/
|
|
6
|
+
export async function getOpenlayersMap(mapOptions) {
|
|
7
|
+
const map = new OpenlayersMap(mapOptions || {});
|
|
8
|
+
await map.initialize();
|
|
9
|
+
return map;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @param {VcsApp} app
|
|
13
|
+
* @returns {Promise<OpenlayersMap>}
|
|
14
|
+
*/
|
|
15
|
+
export async function setOpenlayersMap(app) {
|
|
16
|
+
const map = await getOpenlayersMap({
|
|
17
|
+
layerCollection: app.layers,
|
|
18
|
+
target: app.maps.target,
|
|
19
|
+
});
|
|
20
|
+
app.maps.add(map);
|
|
21
|
+
await app.maps.setActiveMap(map.name);
|
|
22
|
+
return map;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=openlayersHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openlayersHelpers.js","sourceRoot":"","sources":["../../../../tests/unit/helpers/openlayersHelpers.js"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,mCAAmC,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,UAAU;IAC/C,MAAM,GAAG,GAAG,IAAI,aAAa,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;IAChD,MAAM,GAAG,CAAC,UAAU,EAAE,CAAC;IACvB,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAG;IACxC,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC;QACjC,eAAe,EAAE,GAAG,CAAC,MAAM;QAC3B,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM;KACxB,CAAC,CAAC;IACH,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClB,MAAM,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* serves http://myTerrainProvider/terrain/
|
|
3
|
+
* @param {import("nock").Scope} scope
|
|
4
|
+
*/
|
|
5
|
+
export function setTerrainServer(scope: import("nock").Scope): void;
|
|
6
|
+
/**
|
|
7
|
+
* @param {Scope} scope
|
|
8
|
+
* @returns {Promise<cesium/CesiumTerrainProvider>}
|
|
9
|
+
*/
|
|
10
|
+
export function getTerrainProvider(scope: Scope): Promise<cesium>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import { CesiumTerrainProvider } from '@vcmap-cesium/engine';
|
|
3
|
+
import importJSON from '../importJSON.js';
|
|
4
|
+
import getFileNameFromUrl from '../getFileNameFromUrl.js';
|
|
5
|
+
const fileName = getFileNameFromUrl(import.meta.url, '../../../../data/terrain/layer.json');
|
|
6
|
+
const layerJson = await importJSON(fileName);
|
|
7
|
+
const terrainFiles = {
|
|
8
|
+
1388006485: './tests/data/terrain/13/8800/6485.terrain',
|
|
9
|
+
1388006486: './tests/data/terrain/13/8800/6486.terrain',
|
|
10
|
+
1388016485: './tests/data/terrain/13/8801/6485.terrain',
|
|
11
|
+
1388016486: './tests/data/terrain/13/8801/6486.terrain',
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* serves http://myTerrainProvider/terrain/
|
|
15
|
+
* @param {import("nock").Scope} scope
|
|
16
|
+
*/
|
|
17
|
+
export function setTerrainServer(scope) {
|
|
18
|
+
scope
|
|
19
|
+
.get('/terrain/layer.json')
|
|
20
|
+
.reply(200, layerJson, { 'Content-Type': 'application/json' })
|
|
21
|
+
.get(/terrain\/(\d{2})\/(\d{4})\/(\d{4})\.terrain.*/)
|
|
22
|
+
.reply((uri) => {
|
|
23
|
+
const [x, y] = uri.match(/(\d{4})/g);
|
|
24
|
+
const terrainFile = terrainFiles[`13${x}${y}`];
|
|
25
|
+
const res = terrainFile
|
|
26
|
+
? fs.createReadStream(terrainFiles[`13${x}${y}`])
|
|
27
|
+
: Buffer.from('');
|
|
28
|
+
return [200, res, { 'Content-Type': 'application/vnd.quantized-mesh' }];
|
|
29
|
+
})
|
|
30
|
+
.persist();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @param {Scope} scope
|
|
34
|
+
* @returns {Promise<cesium/CesiumTerrainProvider>}
|
|
35
|
+
*/
|
|
36
|
+
export async function getTerrainProvider(scope) {
|
|
37
|
+
setTerrainServer(scope);
|
|
38
|
+
return CesiumTerrainProvider.fromUrl('http://localhost/terrain/', {});
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=terrainData.js.map
|
|
@@ -0,0 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cAAc,EAAE,gCAAgC,EAAE,CAAC,CAAC;IAC1E,CAAC,CAAC;SACD,OAAO,EAAE,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,KAAK;IAC5C,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACxB,OAAO,qBAAqB,CAAC,OAAO,CAAC,2BAA2B,EAAE,EAAE,CAAC,CAAC;AACxE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vcmap/core",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.35",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"coverage": "c8 --reporter text-summary npm run test",
|
|
17
17
|
"coverage:gitlab": "c8 --reporter text-summary npm run test -- --reporter mocha-junit-reporter",
|
|
18
18
|
"build-docs": "typedoc index.ts --out docs",
|
|
19
|
-
"build": "tsc",
|
|
19
|
+
"build": "tsc && node -e \"require('fs').cpSync('tests/data', 'dist/tests/data', { recursive: true })\"",
|
|
20
20
|
"watch": "tsc --watch",
|
|
21
21
|
"prepare": "npm run build"
|
|
22
22
|
},
|
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"build/postinstall.js",
|
|
29
29
|
"src/",
|
|
30
30
|
"dist/",
|
|
31
|
-
"tests/data/",
|
|
32
|
-
"tests/unit/helpers/",
|
|
33
31
|
"LICENSE.md",
|
|
34
32
|
"README.md",
|
|
35
33
|
"index.ts",
|
|
@@ -63,8 +61,8 @@
|
|
|
63
61
|
"typescript": "^5.0.4"
|
|
64
62
|
},
|
|
65
63
|
"peerDependencies": {
|
|
66
|
-
"@vcmap-cesium/engine": "~2.
|
|
67
|
-
"ol": "~7.
|
|
64
|
+
"@vcmap-cesium/engine": "~2.4.1",
|
|
65
|
+
"ol": "~7.4.0"
|
|
68
66
|
},
|
|
69
67
|
"eslintConfig": {
|
|
70
68
|
"extends": [
|
|
@@ -113,9 +111,9 @@
|
|
|
113
111
|
"@vcsuite/logger": "^1.0.1",
|
|
114
112
|
"@vcsuite/parsers": "^1.0.3",
|
|
115
113
|
"fast-deep-equal": "^3.1.3",
|
|
116
|
-
"proj4": "^2.
|
|
114
|
+
"proj4": "^2.9.0",
|
|
117
115
|
"rbush": ">=3.0.1",
|
|
118
116
|
"rbush-knn": "^3.0.1",
|
|
119
|
-
"uuid": "^
|
|
117
|
+
"uuid": "^9.0.0"
|
|
120
118
|
}
|
|
121
119
|
}
|
|
@@ -36,7 +36,7 @@ class VectorRasterTileCesiumImpl extends RasterLayerCesiumImpl {
|
|
|
36
36
|
const rasterLayerOptions: RasterLayerImplementationOptions = {
|
|
37
37
|
...options,
|
|
38
38
|
tilingSchema: TilingScheme.MERCATOR,
|
|
39
|
-
opacity:
|
|
39
|
+
opacity: 1,
|
|
40
40
|
};
|
|
41
41
|
super(map, rasterLayerOptions);
|
|
42
42
|
this.tileProvider = options.tileProvider;
|