@map-colonies/react-components 3.7.3 → 3.9.0
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/CHANGELOG.md +19 -0
- package/dist/autocomplete/autocomplete.css +25 -0
- package/dist/autocomplete/autocomplete.d.ts +34 -0
- package/dist/autocomplete/autocomplete.d.ts.map +1 -0
- package/dist/autocomplete/autocomplete.js +467 -0
- package/dist/autocomplete/autocomplete.js.map +1 -0
- package/dist/autocomplete/index.d.ts +2 -0
- package/dist/autocomplete/index.d.ts.map +1 -0
- package/dist/autocomplete/index.js +5 -0
- package/dist/autocomplete/index.js.map +1 -0
- package/dist/cesium-map/layers/3d.tileset.update.d.ts +2 -0
- package/dist/cesium-map/layers/3d.tileset.update.d.ts.map +1 -0
- package/dist/cesium-map/layers/3d.tileset.update.js +6 -0
- package/dist/cesium-map/layers/3d.tileset.update.js.map +1 -0
- package/dist/cesium-map/layers-manager.d.ts +2 -1
- package/dist/cesium-map/layers-manager.d.ts.map +1 -1
- package/dist/cesium-map/layers-manager.js.map +1 -1
- package/dist/cesium-map/map.d.ts +2 -1
- package/dist/cesium-map/map.d.ts.map +1 -1
- package/dist/cesium-map/map.js.map +1 -1
- package/dist/cesium-map/terrain-providers/custom/dummy-quantized-mesh-tile.d.ts +4 -0
- package/dist/cesium-map/terrain-providers/custom/dummy-quantized-mesh-tile.d.ts.map +1 -0
- package/dist/cesium-map/terrain-providers/custom/dummy-quantized-mesh-tile.js +245 -0
- package/dist/cesium-map/terrain-providers/custom/dummy-quantized-mesh-tile.js.map +1 -0
- package/dist/cesium-map/terrain-providers/custom/quantized-mesh-decoder.d.ts +10 -0
- package/dist/cesium-map/terrain-providers/custom/quantized-mesh-decoder.d.ts.map +1 -0
- package/dist/cesium-map/terrain-providers/custom/quantized-mesh-decoder.js +201 -0
- package/dist/cesium-map/terrain-providers/custom/quantized-mesh-decoder.js.map +1 -0
- package/dist/cesium-map/terrain-providers/custom/quantized-mesh-terrain-provider.d.ts +51 -0
- package/dist/cesium-map/terrain-providers/custom/quantized-mesh-terrain-provider.d.ts.map +1 -0
- package/dist/cesium-map/terrain-providers/custom/quantized-mesh-terrain-provider.js +137 -0
- package/dist/cesium-map/terrain-providers/custom/quantized-mesh-terrain-provider.js.map +1 -0
- package/dist/date-picker/date-picker.css +9 -0
- package/dist/date-picker/date-picker.d.ts +15 -0
- package/dist/date-picker/date-picker.d.ts.map +1 -0
- package/dist/date-picker/date-picker.js +65 -0
- package/dist/date-picker/date-picker.js.map +1 -0
- package/dist/date-picker/index.d.ts +2 -0
- package/dist/date-picker/index.d.ts.map +1 -0
- package/dist/date-picker/index.js +7 -0
- package/dist/date-picker/index.js.map +1 -0
- package/dist/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/date-range-picker/date-range-picker.form-control.d.ts.map +1 -1
- package/dist/date-range-picker/date-range-picker.form-control.js +9 -7
- package/dist/date-range-picker/date-range-picker.form-control.js.map +1 -1
- package/dist/date-range-picker/date-range-picker.js +10 -10
- package/dist/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/models/defaults.d.ts +11 -0
- package/dist/models/defaults.d.ts.map +1 -1
- package/dist/models/defaults.js +12 -0
- package/dist/models/defaults.js.map +1 -1
- package/package.json +100 -95
- package/src/lib/autocomplete/autocomplete.css +25 -0
- package/src/lib/autocomplete/autocomplete.stories.tsx +101 -0
- package/src/lib/autocomplete/autocomplete.tsx +683 -0
- package/src/lib/autocomplete/get-input-selection.d.ts +1 -0
- package/src/lib/autocomplete/index.ts +1 -0
- package/src/lib/cesium-map/context-menu.stories.tsx +1 -2
- package/src/lib/cesium-map/layers/3d.tileset.stories.tsx +1 -2
- package/src/lib/cesium-map/layers/3d.tileset.update.ts +72 -0
- package/src/lib/cesium-map/layers/layers.rect.stories.tsx +171 -0
- package/src/lib/cesium-map/layers-manager.stories.tsx +2 -3
- package/src/lib/cesium-map/layers-manager.ts +3 -1
- package/src/lib/cesium-map/map.stories.tsx +3 -3
- package/src/lib/cesium-map/map.tsx +2 -0
- package/src/lib/cesium-map/terrain-providers/custom/dummy-quantized-mesh-tile.ts +243 -0
- package/src/lib/cesium-map/terrain-providers/custom/quantized-mesh-decoder.ts +321 -0
- package/src/lib/cesium-map/terrain-providers/custom/quantized-mesh-terrain-provider.ts +237 -0
- package/src/lib/cesium-map/terrain-providers/terrain-provider.stories.tsx +183 -0
- package/src/lib/date-picker/date-picker.css +9 -0
- package/src/lib/date-picker/date-picker.stories.tsx +130 -0
- package/src/lib/date-picker/date-picker.tsx +90 -0
- package/src/lib/date-picker/index.ts +1 -0
- package/src/lib/date-range-picker/date-range-picker.form-control.tsx +9 -7
- package/src/lib/date-range-picker/date-range-picker.tsx +12 -10
- package/src/lib/index.ts +2 -0
- package/src/lib/models/defaults.ts +12 -0
- package/src/types/quantized-mesh-decoder.d.ts +1 -0
- /package/storybook-static/mock/{tileset → tileset_1}/ll.b3dm +0 -0
- /package/storybook-static/mock/{tileset → tileset_1}/lr.b3dm +0 -0
- /package/storybook-static/mock/{tileset → tileset_1}/parent.b3dm +0 -0
- /package/storybook-static/mock/{tileset → tileset_1}/tileset.json +0 -0
- /package/storybook-static/mock/{tileset → tileset_1}/ul.b3dm +0 -0
- /package/storybook-static/mock/{tileset → tileset_1}/ur.b3dm +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
https://sandcastle.cesium.com/index.html?#c=fVZtTxs5EP4re3xho0YOkOv1jgC6ElIuiAQKKaWQqnJ2nayL187Z3qCk4r/f+GXf8nKWot3YzzOeGT8z6wWWQRdLTRTFvB2cBl14y1JUznXGfMxbreBSYq798tV9gKOIKBVoESxFJgMqeICVIlqNuTfRFxzFZIozpj9a8Ei8EA5b7JPlVTK5jOgNvep/WfUPh7Sv+vzufdTt/9F/mT8+dK/+QgD6N758MSA6GJ3/HB712gN60H66fHq5Ht0l39K+vvnaWw27h/RmFP+8ueitBqvB+8FqRq+7V/MnMDa8+Kz6KUtieB+MPv8+/Am/i8HBoH2AztvdD0NBlu2n28do+uHHp8fz3rdXKiN91J6qLyS64/eHR5+YHv65b3OwgFRFNrQRkRJTfivFgsZEllmLJMGafBWSxR4TNjqOSRijcyVovEnm5DU30NuBsmacoQUlr+u0BzsX7jv3uoJr4BK53wx+jXkAY4IVucZLIm9p9ALs42CKmSJNt6rXXDreHueYv+XRqIhwAj44Z5D9az20b2jGxITA4c91MiJKf5yBFaW9OaBpmZEiIE0ZAeHAtCPPJU2ppguiEI7j0LlYCdY92hcjxwt9iGZkkh0HpfzuiAJtRgRNpUg/GnX247D9oX3UcJQ3ePrEujhWQqQjEXqPPAoJnRD5ShUJpxmPtJF6CKEI2Qgqe0eCK8EIYmLmVzv5LnaLgpvNYxCJ8T6wOxVWTDImIuMx5bMHwbLUZNggUH3W26XTIPSxQpnBecfWHAJHNOH6vMZp1HzdvstWYh5E6aKHrbE6JSAVMWGw7FfQDztRASSEzhJjoO4HSimnaZb+Y5creJCFtpK3htAPqaOunapguJApZoWInAKLokMzAlRNo/tMTnFEhhYdOsNNp66i44WNRsWwmE6dOksASqGn0Tlbni/vI8ywDN3uTR/Z/xuMYF7UO62YSTxPaGSFWvC8e1XuHNZBiCX7NSG2y/oWkevCJWG9rk9PT3f2oZo+zFaSKIjSHKNxsFMuugVUHOJBZc37hwAj2IKEDltUAuwOzv/awJfxKJzOGfG+DYTSFwR6GQNtbw2pGTxb9743EBQpLwrUb6xqUW1E5kHPB987dZRJ4W9rteVD2bDoUqIzyTcyVSmcNaQzVoG+NcpCcy95KrfFVXOiCGeboLQo5VQ/jEJSQlHbl2oKV9lESxxpT2r6MtitbDPWy7NuMmKCkzDfrrmBrvXLtx0t0zR8KUSZAXNUZiLvQ3cEx8tafkqyY+4Uo8kGowqsWNf9VwCZ57XAsfka9RawxbXHlKdSa+NVEZkFW3Y1n6uj4p210tmE5D6Fjd3a2tSPbTUJZbG0ly6XI/+/0lEY4TOdmDL3a8jNeMhUyCA0OGorHR4nntIJ3r2jOxJtTim390y/V3yz7t1jHkdYafh6QE5HYjZj5DzTGjK5n18SehxPoOzhCmMuC82gyHWUELjCxDUBrM+ZsaMFbr/a7NTELiu72uj6KdRzkksq16E9tb3m3onSS0bOHOVvms6F1OYyEyLU0gQ6IthQrUkGQcIhKmVoJ62cdBLTRUDj0/He2v1vvBdEDG7lsDLNGLunKzLeOztpAb5GY6Bu+ArfLIhkeGkgyeHZtZtECJ204O8mSwvBJlhWLP4H
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
import {
|
|
7
|
+
Cesium3DTileset,
|
|
8
|
+
Cesium3DTile,
|
|
9
|
+
Cartographic,
|
|
10
|
+
Cartesian3,
|
|
11
|
+
defined,
|
|
12
|
+
sampleTerrainMostDetailed,
|
|
13
|
+
} from 'cesium';
|
|
14
|
+
|
|
15
|
+
const updateTile = (tile: Cesium3DTile): void => {
|
|
16
|
+
const boundingVolume = tile.boundingVolume;
|
|
17
|
+
if (defined(tile.contentBoundingVolume)) {
|
|
18
|
+
boundingVolume = tile.contentBoundingVolume;
|
|
19
|
+
}
|
|
20
|
+
const content = tile.content;
|
|
21
|
+
const model = content._model;
|
|
22
|
+
const height = boundingVolume.minimumHeight;
|
|
23
|
+
const center = model._rtcCenter;
|
|
24
|
+
const normal = scene.globe.ellipsoid.geodeticSurfaceNormal(center, new Cartesian3());
|
|
25
|
+
const offset = Cartesian3.multiplyByScalar(normal, height, new Cartesian3());
|
|
26
|
+
const carto = Cartographic.fromCartesian(center);
|
|
27
|
+
const promise = when.defer();
|
|
28
|
+
if (scene.terrainProvider === ellipsoidTerrainProvider) {
|
|
29
|
+
const result = carto;
|
|
30
|
+
result.height = 0;
|
|
31
|
+
promise.resolve(result);
|
|
32
|
+
} else {
|
|
33
|
+
promise = sampleTerrainMostDetailed(scene.terrainProvider, [carto]).then((results) => {
|
|
34
|
+
const result = results[0];
|
|
35
|
+
if (!defined(result)) {
|
|
36
|
+
return carto;
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
promise.then((result) => {
|
|
42
|
+
result = Cartographic.toCartesian(result);
|
|
43
|
+
const position = Cartesian3.subtract(result, offset, new Cartesian3());
|
|
44
|
+
model._rtcCenter = Cartesian3.clone(position, model._rtcCenter);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const updateTileset = (root: Cesium3DTile): void => {
|
|
49
|
+
if (root.contentReady) {
|
|
50
|
+
updateTile(root);
|
|
51
|
+
} else {
|
|
52
|
+
const listener = (tileset as Cesium3DTileset).tileLoad.addEventListener(
|
|
53
|
+
(tile: Cesium3DTile) => {
|
|
54
|
+
if (tile === root) {
|
|
55
|
+
updateTile(tile);
|
|
56
|
+
listener();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
const children = root.children;
|
|
62
|
+
const length = children.length;
|
|
63
|
+
for (let i = 0; i < length; ++i) {
|
|
64
|
+
updateTileset(children[i]);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const update = (tileset: Cesium3DTileset): void => {
|
|
69
|
+
updateTileset(tileset.root);
|
|
70
|
+
};
|
|
71
|
+
*/
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import React, { useLayoutEffect, useState } from 'react';
|
|
2
|
+
import { Rectangle, Color } from 'cesium';
|
|
3
|
+
import { Story, Meta } from '@storybook/react/types-6-0';
|
|
4
|
+
import bbox from '@turf/bbox';
|
|
5
|
+
import { CesiumMap, CesiumMapProps, useCesiumMap } from '../map';
|
|
6
|
+
import { CesiumSceneMode } from '../map.types';
|
|
7
|
+
import { IRasterLayer, LayerType } from '../layers-manager';
|
|
8
|
+
import { IBaseMaps } from '../settings/settings';
|
|
9
|
+
import { CesiumXYZLayer } from './xyz.layer';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Cesium Map/Layers/LayersRect',
|
|
13
|
+
component: CesiumMap,
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: 'fullscreen',
|
|
16
|
+
},
|
|
17
|
+
} as Meta;
|
|
18
|
+
|
|
19
|
+
const mapDivStyle = {
|
|
20
|
+
height: '90%',
|
|
21
|
+
width: '100%',
|
|
22
|
+
position: 'absolute' as const,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const BASE_MAPS = {
|
|
26
|
+
maps: [
|
|
27
|
+
{
|
|
28
|
+
id: '3rd',
|
|
29
|
+
title: '3rd Map Title',
|
|
30
|
+
isCurrent: true,
|
|
31
|
+
thumbnail:
|
|
32
|
+
'https://nsw.digitaltwin.terria.io/build/d8b97d3e38a0d43e5a06dea9aae17a3e.png',
|
|
33
|
+
baseRasteLayers: [
|
|
34
|
+
{
|
|
35
|
+
id: 'VECTOR_TILES',
|
|
36
|
+
type: 'XYZ_LAYER',
|
|
37
|
+
opacity: 1,
|
|
38
|
+
zIndex: 0,
|
|
39
|
+
options: {
|
|
40
|
+
url:
|
|
41
|
+
'https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=6170aad10dfd42a38d4d8c709a536f38',
|
|
42
|
+
layers: '',
|
|
43
|
+
credit: 'thunderforest',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 'VECTOR_TILES_GPS',
|
|
48
|
+
type: 'XYZ_LAYER',
|
|
49
|
+
opacity: 1,
|
|
50
|
+
zIndex: 1,
|
|
51
|
+
options: {
|
|
52
|
+
url: 'https://gps.tile.openstreetmap.org/lines/{z}/{x}/{y}.png',
|
|
53
|
+
layers: '',
|
|
54
|
+
credit: 'openstreetmap',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'WMTS_POPULATION_TILES',
|
|
59
|
+
type: 'WMTS_LAYER',
|
|
60
|
+
opacity: 0.4,
|
|
61
|
+
zIndex: 2,
|
|
62
|
+
options: {
|
|
63
|
+
url:
|
|
64
|
+
'https://services.arcgisonline.com/arcgis/rest/services/Demographics/USA_Population_Density/MapServer/WMTS/',
|
|
65
|
+
layer: 'USGSShadedReliefOnly',
|
|
66
|
+
style: 'default',
|
|
67
|
+
format: 'image/jpeg',
|
|
68
|
+
tileMatrixSetID: 'default028mm',
|
|
69
|
+
maximumLevel: 19,
|
|
70
|
+
credit: 'U. S. Geological Survey',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
baseVectorLayers: [],
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const mapViewProps: CesiumMapProps = {
|
|
80
|
+
center: [34.811, 31.908],
|
|
81
|
+
zoom: 14,
|
|
82
|
+
imageryProvider: false,
|
|
83
|
+
sceneModes: [CesiumSceneMode.SCENE3D, CesiumSceneMode.COLUMBUS_VIEW],
|
|
84
|
+
baseMaps: BASE_MAPS as IBaseMaps,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const optionsRectXYZ = {
|
|
88
|
+
url:
|
|
89
|
+
'https://tiles.openaerialmap.org/5a831b4a2553e6000ce5ac80/0/d02ddc76-9c2e-4994-97d4-a623eb371456/{z}/{x}/{y}.png',
|
|
90
|
+
footprint: {
|
|
91
|
+
type: 'Polygon',
|
|
92
|
+
coordinates: [
|
|
93
|
+
[
|
|
94
|
+
[34.8043847068541, 31.9023297972932],
|
|
95
|
+
[34.8142791322292, 31.9023297972932],
|
|
96
|
+
[34.8142791322292, 31.9108796531516],
|
|
97
|
+
[34.8043847068541, 31.9108796531516],
|
|
98
|
+
[34.8043847068541, 31.9023297972932],
|
|
99
|
+
],
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// Use Turf.js/bbox to calculate the bounding box from the supplied footprint.
|
|
105
|
+
|
|
106
|
+
const childLayerRect = Rectangle.fromDegrees(...bbox(optionsRectXYZ.footprint));
|
|
107
|
+
|
|
108
|
+
export const MapWithXYZLayersAndRect: Story = () => (
|
|
109
|
+
<div style={mapDivStyle}>
|
|
110
|
+
<CesiumMap {...mapViewProps}>
|
|
111
|
+
<CesiumXYZLayer rectangle={childLayerRect} options={optionsRectXYZ} />
|
|
112
|
+
</CesiumMap>
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
MapWithXYZLayersAndRect.storyName = 'XYZ child layer with rect';
|
|
117
|
+
|
|
118
|
+
export const MapWithSettings: Story = () => {
|
|
119
|
+
const layer = {
|
|
120
|
+
id: '2_raster_ext',
|
|
121
|
+
type: 'XYZ_LAYER' as LayerType,
|
|
122
|
+
opacity: 1,
|
|
123
|
+
zIndex: 0,
|
|
124
|
+
show: true,
|
|
125
|
+
options: {
|
|
126
|
+
url:
|
|
127
|
+
'https://tiles.openaerialmap.org/5a9f90c42553e6000ce5ad6c/0/eee1a570-128e-4947-9ffa-1e69c1efab7c/{z}/{x}/{y}.png',
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<div style={mapDivStyle}>
|
|
133
|
+
<CesiumMap {...mapViewProps}>
|
|
134
|
+
<LayerViewer layer={layer as IRasterLayer} />
|
|
135
|
+
</CesiumMap>
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
MapWithSettings.storyName = 'Layer manager rect';
|
|
140
|
+
|
|
141
|
+
interface ILayerViewerProps {
|
|
142
|
+
layer: IRasterLayer;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const LayerViewer: React.FC<ILayerViewerProps> = (props) => {
|
|
146
|
+
const mapViewer = useCesiumMap();
|
|
147
|
+
const { layer } = props;
|
|
148
|
+
|
|
149
|
+
// Mockin footprint data on layer meta
|
|
150
|
+
const layerFootprint = {
|
|
151
|
+
type: 'Polygon',
|
|
152
|
+
coordinates: [
|
|
153
|
+
[
|
|
154
|
+
[34.8099445223518, 31.9061345394902],
|
|
155
|
+
[34.8200994167574, 31.9061345394902],
|
|
156
|
+
[34.8200994167574, 31.9106311613979],
|
|
157
|
+
[34.8099445223518, 31.9106311613979],
|
|
158
|
+
[34.8099445223518, 31.9061345394902],
|
|
159
|
+
],
|
|
160
|
+
],
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
useLayoutEffect(() => {
|
|
164
|
+
const layerManagerRect = Rectangle.fromDegrees(...bbox(layerFootprint));
|
|
165
|
+
|
|
166
|
+
layer.options.rectangle = layerManagerRect;
|
|
167
|
+
|
|
168
|
+
mapViewer.layersManager?.addRasterLayer(layer, 0, '');
|
|
169
|
+
}, [mapViewer, layerFootprint, layer]);
|
|
170
|
+
return <></>;
|
|
171
|
+
};
|
|
@@ -5,7 +5,7 @@ import { CesiumSceneMode } from './map.types';
|
|
|
5
5
|
import { IRasterLayer } from './layers-manager';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
|
-
title: 'Cesium Map
|
|
8
|
+
title: 'Cesium Map',
|
|
9
9
|
component: CesiumMap,
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: 'fullscreen',
|
|
@@ -191,7 +191,7 @@ const layers = [
|
|
|
191
191
|
},
|
|
192
192
|
];
|
|
193
193
|
|
|
194
|
-
export const
|
|
194
|
+
export const LayersManager: Story = () => {
|
|
195
195
|
const [center] = useState<[number, number]>([34.811, 31.908]);
|
|
196
196
|
return (
|
|
197
197
|
<div style={mapDivStyle}>
|
|
@@ -207,7 +207,6 @@ export const MapWithSettings: Story = () => {
|
|
|
207
207
|
</div>
|
|
208
208
|
);
|
|
209
209
|
};
|
|
210
|
-
MapWithSettings.storyName = 'Map Layer Manager';
|
|
211
210
|
|
|
212
211
|
interface ILayersMozaikProps {
|
|
213
212
|
layers: IRasterLayer[];
|
|
@@ -25,9 +25,11 @@ export interface ICesiumImageryLayer extends InstanceType<typeof ImageryLayer> {
|
|
|
25
25
|
meta?: Record<string, unknown>;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
export type LayerType = 'OSM_LAYER' | 'WMTS_LAYER' | 'WMS_LAYER' | 'XYZ_LAYER';
|
|
29
|
+
|
|
28
30
|
export interface IRasterLayer {
|
|
29
31
|
id: string;
|
|
30
|
-
type:
|
|
32
|
+
type: LayerType;
|
|
31
33
|
opacity: number;
|
|
32
34
|
zIndex: number;
|
|
33
35
|
show?: boolean;
|
|
@@ -24,13 +24,13 @@ export const BaseMap: Story = (args: CesiumMapProps) => (
|
|
|
24
24
|
</div>
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
-
export const
|
|
27
|
+
export const ZoomedMap: Story = (args: CesiumMapProps) => (
|
|
28
28
|
<div style={mapDivStyle}>
|
|
29
29
|
<CesiumMap {...args}></CesiumMap>
|
|
30
30
|
</div>
|
|
31
31
|
);
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
ZoomedMap.argTypes = {
|
|
34
34
|
center: {
|
|
35
35
|
defaultValue: [34.9578094, 32.8178637],
|
|
36
36
|
},
|
|
@@ -100,7 +100,7 @@ Map2DWithProjection.argTypes = {
|
|
|
100
100
|
},
|
|
101
101
|
},
|
|
102
102
|
};
|
|
103
|
-
Map2DWithProjection.storyName = '2D Map
|
|
103
|
+
Map2DWithProjection.storyName = '2D Map With Projection';
|
|
104
104
|
|
|
105
105
|
export const LocalizedMap: Story = (args: CesiumMapProps) => (
|
|
106
106
|
<div style={mapDivStyle}>
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
PerspectiveOffCenterFrustum,
|
|
18
18
|
OrthographicFrustum,
|
|
19
19
|
ScreenSpaceEventType,
|
|
20
|
+
TerrainProvider,
|
|
20
21
|
} from 'cesium';
|
|
21
22
|
import { isNumber, isArray } from 'lodash';
|
|
22
23
|
import { getAltitude, toDegrees } from '../utils/map';
|
|
@@ -87,6 +88,7 @@ export interface CesiumMapProps extends ViewerProps {
|
|
|
87
88
|
locale?: { [key: string]: string };
|
|
88
89
|
sceneModes?: CesiumSceneModeEnum[];
|
|
89
90
|
baseMaps?: IBaseMaps;
|
|
91
|
+
terrainProvider?: TerrainProvider;
|
|
90
92
|
imageryContextMenu?: React.ReactElement<IContextMenuData>;
|
|
91
93
|
imageryContextMenuSize?: {
|
|
92
94
|
height: number;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
+
export const dummyTile = new Uint8Array([
|
|
3
|
+
172,
|
|
4
|
+
223,
|
|
5
|
+
96,
|
|
6
|
+
7,
|
|
7
|
+
210,
|
|
8
|
+
166,
|
|
9
|
+
80,
|
|
10
|
+
193,
|
|
11
|
+
62,
|
|
12
|
+
133,
|
|
13
|
+
0,
|
|
14
|
+
92,
|
|
15
|
+
97,
|
|
16
|
+
125,
|
|
17
|
+
81,
|
|
18
|
+
193,
|
|
19
|
+
175,
|
|
20
|
+
204,
|
|
21
|
+
114,
|
|
22
|
+
156,
|
|
23
|
+
24,
|
|
24
|
+
171,
|
|
25
|
+
39,
|
|
26
|
+
65,
|
|
27
|
+
215,
|
|
28
|
+
131,
|
|
29
|
+
189,
|
|
30
|
+
193,
|
|
31
|
+
92,
|
|
32
|
+
143,
|
|
33
|
+
98,
|
|
34
|
+
193,
|
|
35
|
+
172,
|
|
36
|
+
223,
|
|
37
|
+
224,
|
|
38
|
+
55,
|
|
39
|
+
148,
|
|
40
|
+
164,
|
|
41
|
+
80,
|
|
42
|
+
193,
|
|
43
|
+
62,
|
|
44
|
+
133,
|
|
45
|
+
128,
|
|
46
|
+
115,
|
|
47
|
+
254,
|
|
48
|
+
122,
|
|
49
|
+
81,
|
|
50
|
+
193,
|
|
51
|
+
175,
|
|
52
|
+
204,
|
|
53
|
+
114,
|
|
54
|
+
40,
|
|
55
|
+
74,
|
|
56
|
+
169,
|
|
57
|
+
39,
|
|
58
|
+
65,
|
|
59
|
+
199,
|
|
60
|
+
225,
|
|
61
|
+
33,
|
|
62
|
+
1,
|
|
63
|
+
165,
|
|
64
|
+
221,
|
|
65
|
+
10,
|
|
66
|
+
65,
|
|
67
|
+
165,
|
|
68
|
+
248,
|
|
69
|
+
77,
|
|
70
|
+
38,
|
|
71
|
+
221,
|
|
72
|
+
233,
|
|
73
|
+
229,
|
|
74
|
+
191,
|
|
75
|
+
118,
|
|
76
|
+
168,
|
|
77
|
+
124,
|
|
78
|
+
106,
|
|
79
|
+
57,
|
|
80
|
+
4,
|
|
81
|
+
231,
|
|
82
|
+
191,
|
|
83
|
+
208,
|
|
84
|
+
126,
|
|
85
|
+
103,
|
|
86
|
+
119,
|
|
87
|
+
149,
|
|
88
|
+
64,
|
|
89
|
+
191,
|
|
90
|
+
63,
|
|
91
|
+
9,
|
|
92
|
+
0,
|
|
93
|
+
0,
|
|
94
|
+
0,
|
|
95
|
+
254,
|
|
96
|
+
127,
|
|
97
|
+
253,
|
|
98
|
+
127,
|
|
99
|
+
254,
|
|
100
|
+
127,
|
|
101
|
+
253,
|
|
102
|
+
127,
|
|
103
|
+
0,
|
|
104
|
+
0,
|
|
105
|
+
254,
|
|
106
|
+
255,
|
|
107
|
+
255,
|
|
108
|
+
127,
|
|
109
|
+
0,
|
|
110
|
+
128,
|
|
111
|
+
0,
|
|
112
|
+
0,
|
|
113
|
+
254,
|
|
114
|
+
127,
|
|
115
|
+
253,
|
|
116
|
+
127,
|
|
117
|
+
0,
|
|
118
|
+
0,
|
|
119
|
+
254,
|
|
120
|
+
127,
|
|
121
|
+
0,
|
|
122
|
+
128,
|
|
123
|
+
0,
|
|
124
|
+
0,
|
|
125
|
+
0,
|
|
126
|
+
0,
|
|
127
|
+
253,
|
|
128
|
+
255,
|
|
129
|
+
254,
|
|
130
|
+
127,
|
|
131
|
+
0,
|
|
132
|
+
0,
|
|
133
|
+
0,
|
|
134
|
+
0,
|
|
135
|
+
0,
|
|
136
|
+
0,
|
|
137
|
+
0,
|
|
138
|
+
0,
|
|
139
|
+
0,
|
|
140
|
+
0,
|
|
141
|
+
0,
|
|
142
|
+
0,
|
|
143
|
+
0,
|
|
144
|
+
0,
|
|
145
|
+
0,
|
|
146
|
+
0,
|
|
147
|
+
0,
|
|
148
|
+
0,
|
|
149
|
+
8,
|
|
150
|
+
0,
|
|
151
|
+
0,
|
|
152
|
+
0,
|
|
153
|
+
0,
|
|
154
|
+
0,
|
|
155
|
+
0,
|
|
156
|
+
0,
|
|
157
|
+
0,
|
|
158
|
+
0,
|
|
159
|
+
2,
|
|
160
|
+
0,
|
|
161
|
+
3,
|
|
162
|
+
0,
|
|
163
|
+
0,
|
|
164
|
+
0,
|
|
165
|
+
4,
|
|
166
|
+
0,
|
|
167
|
+
0,
|
|
168
|
+
0,
|
|
169
|
+
2,
|
|
170
|
+
0,
|
|
171
|
+
5,
|
|
172
|
+
0,
|
|
173
|
+
0,
|
|
174
|
+
0,
|
|
175
|
+
0,
|
|
176
|
+
0,
|
|
177
|
+
7,
|
|
178
|
+
0,
|
|
179
|
+
0,
|
|
180
|
+
0,
|
|
181
|
+
0,
|
|
182
|
+
0,
|
|
183
|
+
2,
|
|
184
|
+
0,
|
|
185
|
+
9,
|
|
186
|
+
0,
|
|
187
|
+
7,
|
|
188
|
+
0,
|
|
189
|
+
4,
|
|
190
|
+
0,
|
|
191
|
+
9,
|
|
192
|
+
0,
|
|
193
|
+
1,
|
|
194
|
+
0,
|
|
195
|
+
5,
|
|
196
|
+
0,
|
|
197
|
+
9,
|
|
198
|
+
0,
|
|
199
|
+
3,
|
|
200
|
+
0,
|
|
201
|
+
3,
|
|
202
|
+
0,
|
|
203
|
+
0,
|
|
204
|
+
0,
|
|
205
|
+
0,
|
|
206
|
+
0,
|
|
207
|
+
0,
|
|
208
|
+
0,
|
|
209
|
+
3,
|
|
210
|
+
0,
|
|
211
|
+
3,
|
|
212
|
+
0,
|
|
213
|
+
0,
|
|
214
|
+
0,
|
|
215
|
+
1,
|
|
216
|
+
0,
|
|
217
|
+
7,
|
|
218
|
+
0,
|
|
219
|
+
2,
|
|
220
|
+
0,
|
|
221
|
+
3,
|
|
222
|
+
0,
|
|
223
|
+
0,
|
|
224
|
+
0,
|
|
225
|
+
7,
|
|
226
|
+
0,
|
|
227
|
+
5,
|
|
228
|
+
0,
|
|
229
|
+
8,
|
|
230
|
+
0,
|
|
231
|
+
3,
|
|
232
|
+
0,
|
|
233
|
+
0,
|
|
234
|
+
0,
|
|
235
|
+
4,
|
|
236
|
+
0,
|
|
237
|
+
5,
|
|
238
|
+
0,
|
|
239
|
+
6,
|
|
240
|
+
0,
|
|
241
|
+
]);
|
|
242
|
+
|
|
243
|
+
export default dummyTile.buffer;
|