@reearth/core 0.0.6 → 0.0.7-alpha.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/dist/core.js +8312 -8318
- package/dist/core.umd.cjs +75 -75
- package/dist/index.d.ts +183 -184
- package/package.json +1 -1
- package/src/Map/ClusteredLayers/index.tsx +2 -2
- package/src/Map/Layer/index.tsx +3 -3
- package/src/Map/Layers/index.tsx +2 -2
- package/src/Map/hooks.ts +0 -4
- package/src/Map/index.tsx +8 -5
- package/src/Map/types/index.ts +5 -182
- package/src/Map/types/viewerProperty.ts +216 -0
- package/src/Map/useTimelineManager.ts +2 -2
- package/src/Map/utils.ts +1 -43
- package/src/Visualizer/coreContext.tsx +1 -8
- package/src/Visualizer/hooks.ts +6 -75
- package/src/Visualizer/index.stories.tsx +4 -48
- package/src/Visualizer/index.tsx +8 -6
- package/src/Visualizer/useCoreAPI.ts +30 -0
- package/src/engines/Cesium/Feature/Ellipse/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Frustum/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Model/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Model/index.tsx +10 -9
- package/src/engines/Cesium/Feature/Polygon/index.stories.tsx +8 -6
- package/src/engines/Cesium/Feature/Raster/index.stories.tsx +2 -2
- package/src/engines/Cesium/Feature/Resource/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +12 -11
- package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +1 -1
- package/src/engines/Cesium/Feature/Tileset/index.tsx +4 -4
- package/src/engines/Cesium/Feature/index.tsx +5 -4
- package/src/engines/Cesium/Feature/utils.tsx +2 -2
- package/src/engines/Cesium/core/Globe.tsx +36 -68
- package/src/engines/Cesium/core/Imagery.test.ts +9 -9
- package/src/engines/Cesium/core/Imagery.tsx +17 -19
- package/src/engines/Cesium/core/Indicator/Indicator.tsx +8 -8
- package/src/engines/Cesium/hooks/useCamera.ts +144 -0
- package/src/engines/Cesium/{cameraLimiter.ts → hooks/useCameraLimiter.ts} +22 -45
- package/src/engines/Cesium/{useEngineRef.test.tsx → hooks/useEngineRef.test.tsx} +14 -10
- package/src/engines/Cesium/{useEngineRef.ts → hooks/useEngineRef.ts} +17 -17
- package/src/engines/Cesium/hooks/useExplicitRender.ts +65 -0
- package/src/engines/Cesium/hooks/useLayerDragDrop.ts +77 -0
- package/src/engines/Cesium/{VertexTerrainElevationMaterial.ts → hooks/useOverrideGlobeShader/VertexTerrainElevationMaterial.ts} +3 -2
- package/src/engines/Cesium/{useOverrideGlobeShader.ts → hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts} +19 -16
- package/src/engines/Cesium/hooks/useViewerProperty.ts +90 -0
- package/src/engines/Cesium/hooks.ts +117 -353
- package/src/engines/Cesium/index.stories.tsx +1 -1
- package/src/engines/Cesium/index.tsx +48 -50
- package/src/engines/index.ts +1 -1
- /package/src/engines/Cesium/{JapanSeaLevelEllipsoid.ts → hooks/useOverrideGlobeShader/JapanSeaLevelEllipsoid.ts} +0 -0
- /package/src/engines/Cesium/{vertexTerrainElevationMaterial.glsl → hooks/useOverrideGlobeShader/vertexTerrainElevationMaterial.glsl} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,13 @@ import { RefObject } from 'react';
|
|
|
20
20
|
import { RequireExactlyOne } from 'type-fest';
|
|
21
21
|
import { WritableAtom } from 'jotai';
|
|
22
22
|
|
|
23
|
+
export declare type AmbientOcclusionProperty = {
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
quality?: "low" | "medium" | "high" | "extreme";
|
|
26
|
+
intensity?: number;
|
|
27
|
+
ambientOcclusionOnly?: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
23
30
|
export declare const appearanceKeyObj: {
|
|
24
31
|
[k in keyof AppearanceTypes]: 1;
|
|
25
32
|
};
|
|
@@ -46,6 +53,18 @@ export declare type AppearanceTypes = {
|
|
|
46
53
|
declare type Array_2 = any[];
|
|
47
54
|
export { Array_2 as Array }
|
|
48
55
|
|
|
56
|
+
export declare type AssetsCesiumProperty = {
|
|
57
|
+
terrian?: {
|
|
58
|
+
ionAccessToken?: string;
|
|
59
|
+
ionAsset?: string;
|
|
60
|
+
ionUrl?: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export declare type AssetsProperty = {
|
|
65
|
+
cesium?: AssetsCesiumProperty;
|
|
66
|
+
};
|
|
67
|
+
|
|
49
68
|
export declare type Atom = ReturnType<typeof computeAtom>;
|
|
50
69
|
|
|
51
70
|
export declare type Bound = {
|
|
@@ -100,6 +119,14 @@ export declare type Camera = {
|
|
|
100
119
|
aspectRatio?: number;
|
|
101
120
|
};
|
|
102
121
|
|
|
122
|
+
export declare type CameraLimiterProperty = {
|
|
123
|
+
enabled?: boolean;
|
|
124
|
+
targetArea?: Camera;
|
|
125
|
+
targetWidth?: number;
|
|
126
|
+
targetLength?: number;
|
|
127
|
+
showHelper?: boolean;
|
|
128
|
+
};
|
|
129
|
+
|
|
103
130
|
export declare type CameraOptions = {
|
|
104
131
|
/** Seconds */
|
|
105
132
|
duration?: number;
|
|
@@ -127,6 +154,12 @@ export declare type CameraPosition = {
|
|
|
127
154
|
aspectRatio?: number;
|
|
128
155
|
};
|
|
129
156
|
|
|
157
|
+
export declare type CameraProperty = {
|
|
158
|
+
camera?: Camera;
|
|
159
|
+
allowEnterGround?: boolean;
|
|
160
|
+
limiter?: CameraLimiterProperty;
|
|
161
|
+
};
|
|
162
|
+
|
|
130
163
|
export declare type Cesium3DTilesAppearance = {
|
|
131
164
|
show?: boolean;
|
|
132
165
|
color?: string;
|
|
@@ -285,8 +318,6 @@ declare type CoreContext = {
|
|
|
285
318
|
};
|
|
286
319
|
selectedComputedFeature?: ComputedFeature | undefined;
|
|
287
320
|
viewport?: Viewport;
|
|
288
|
-
overriddenSceneProperty?: SceneProperty;
|
|
289
|
-
overrideSceneProperty?: (pluginId: string, property: SceneProperty) => void;
|
|
290
321
|
handleCameraForceHorizontalRollChange?: (enable?: boolean) => void;
|
|
291
322
|
handleInteractionModeChange?: (mode?: InteractionModeType | undefined) => void;
|
|
292
323
|
onSketchPluginFeatureCreate?: (cb: SketchEventCallback) => void;
|
|
@@ -309,9 +340,10 @@ export declare type CoreVisualizerProps = {
|
|
|
309
340
|
engine?: EngineType;
|
|
310
341
|
isBuilt?: boolean;
|
|
311
342
|
isEditable?: boolean;
|
|
312
|
-
|
|
343
|
+
viewerProperty?: ViewerProperty;
|
|
313
344
|
layers?: Layer[];
|
|
314
345
|
clusters?: Cluster[];
|
|
346
|
+
time?: string | Date;
|
|
315
347
|
camera?: Camera;
|
|
316
348
|
interactionMode?: InteractionModeType;
|
|
317
349
|
shouldRender?: boolean;
|
|
@@ -371,6 +403,11 @@ export declare type DataRange = {
|
|
|
371
403
|
|
|
372
404
|
export declare type DataType = "geojson" | "3dtiles" | "osm-buildings" | "google-photorealistic" | "czml" | "csv" | "wms" | "mvt" | "kml" | "gpx" | "shapefile" | "gtfs" | "gml" | "georss" | "gltf" | "tiles" | "tms" | "heatMap";
|
|
373
405
|
|
|
406
|
+
export declare type DebugProperty = {
|
|
407
|
+
showGlobeWireframe?: boolean;
|
|
408
|
+
showFramesPerSecond?: boolean;
|
|
409
|
+
};
|
|
410
|
+
|
|
374
411
|
export declare type DefaultInfobox = {
|
|
375
412
|
title?: string;
|
|
376
413
|
content: {
|
|
@@ -428,7 +465,8 @@ export declare type EngineProps = {
|
|
|
428
465
|
style?: CSSProperties;
|
|
429
466
|
isEditable?: boolean;
|
|
430
467
|
isBuilt?: boolean;
|
|
431
|
-
property?:
|
|
468
|
+
property?: ViewerProperty;
|
|
469
|
+
time?: string | Date;
|
|
432
470
|
camera?: Camera;
|
|
433
471
|
cameraForceHorizontalRoll?: boolean;
|
|
434
472
|
small?: boolean;
|
|
@@ -655,7 +693,7 @@ export declare const FEATURE_FLAGS: {
|
|
|
655
693
|
|
|
656
694
|
export declare type FeatureComponentProps = {
|
|
657
695
|
layer: ComputedLayer;
|
|
658
|
-
|
|
696
|
+
viewerProperty?: ViewerProperty;
|
|
659
697
|
onFeatureRequest?: (range: DataRange) => void;
|
|
660
698
|
onLayerFetch?: (value: Partial<Pick<LayerSimple, "properties">>) => void;
|
|
661
699
|
onFeatureFetch?: (features: Feature[]) => void;
|
|
@@ -686,6 +724,11 @@ export declare type FlyToDestination = {
|
|
|
686
724
|
fov?: number;
|
|
687
725
|
};
|
|
688
726
|
|
|
727
|
+
export declare type FogProperty = {
|
|
728
|
+
enabled?: boolean;
|
|
729
|
+
density?: number;
|
|
730
|
+
};
|
|
731
|
+
|
|
689
732
|
export declare type FrustumAppearance = {
|
|
690
733
|
show?: boolean;
|
|
691
734
|
color?: string;
|
|
@@ -721,6 +764,21 @@ declare const globalDataFeaturesCache: {
|
|
|
721
764
|
getAll: Atom_2<(key: string) => Feature[][] | undefined>;
|
|
722
765
|
};
|
|
723
766
|
|
|
767
|
+
export declare type GlobeAtmosphereProperty = {
|
|
768
|
+
enabled?: boolean;
|
|
769
|
+
lightIntensity?: number;
|
|
770
|
+
brightnessShift?: number;
|
|
771
|
+
hueShift?: number;
|
|
772
|
+
saturationShift?: number;
|
|
773
|
+
};
|
|
774
|
+
|
|
775
|
+
export declare type GlobeProperty = {
|
|
776
|
+
baseColor?: string;
|
|
777
|
+
enableLighting?: boolean;
|
|
778
|
+
atmosphere?: GlobeAtmosphereProperty;
|
|
779
|
+
depthTestAgainstTerrain?: boolean;
|
|
780
|
+
};
|
|
781
|
+
|
|
724
782
|
export declare function guessType(url: string | undefined): DataType | undefined;
|
|
725
783
|
|
|
726
784
|
export declare type HeatMapAppearance = {
|
|
@@ -739,7 +797,26 @@ export declare type HeatMapAppearance = {
|
|
|
739
797
|
logarithmic?: boolean;
|
|
740
798
|
};
|
|
741
799
|
|
|
742
|
-
export declare type
|
|
800
|
+
export declare type HeightMapProperty = {
|
|
801
|
+
type?: "custom";
|
|
802
|
+
colorLUT?: LUT;
|
|
803
|
+
minHeight?: number;
|
|
804
|
+
maxHeight?: number;
|
|
805
|
+
logarithmic?: boolean;
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
export declare type ImageBasedLighting = {
|
|
809
|
+
enabled?: boolean;
|
|
810
|
+
intensity?: number;
|
|
811
|
+
specularEnvironmentMaps?: string;
|
|
812
|
+
sphericalHarmonicCoefficients?: [number, number, number][];
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
export declare type IndicatorProperty = {
|
|
816
|
+
type?: "default" | "crosshair" | "custom";
|
|
817
|
+
image?: string;
|
|
818
|
+
imageScale?: number;
|
|
819
|
+
};
|
|
743
820
|
|
|
744
821
|
declare type Infobox<BP = any> = {
|
|
745
822
|
featureId?: string;
|
|
@@ -967,100 +1044,11 @@ export declare type LegacyPhotooverlayAppearance = {
|
|
|
967
1044
|
far?: number;
|
|
968
1045
|
};
|
|
969
1046
|
|
|
970
|
-
declare type
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
bgcolor?: string;
|
|
976
|
-
ion?: string;
|
|
977
|
-
sceneMode?: SceneMode;
|
|
978
|
-
vr?: boolean;
|
|
979
|
-
} & TerrainProperty;
|
|
980
|
-
cameraLimiter?: {
|
|
981
|
-
cameraLimitterEnabled?: boolean;
|
|
982
|
-
cameraLimitterShowHelper?: boolean;
|
|
983
|
-
cameraLimitterTargetArea?: Camera;
|
|
984
|
-
cameraLimitterTargetWidth?: number;
|
|
985
|
-
cameraLimitterTargetLength?: number;
|
|
986
|
-
};
|
|
987
|
-
indicator?: {
|
|
988
|
-
indicator_type: IndicatorTypes;
|
|
989
|
-
indicator_image?: string;
|
|
990
|
-
indicator_image_scale?: number;
|
|
991
|
-
};
|
|
992
|
-
tiles?: {
|
|
993
|
-
id: string;
|
|
994
|
-
tile_type?: string;
|
|
995
|
-
tile_url?: string;
|
|
996
|
-
tile_zoomLevel?: number[];
|
|
997
|
-
tile_opacity?: number;
|
|
998
|
-
}[];
|
|
999
|
-
terrain?: TerrainProperty;
|
|
1000
|
-
atmosphere?: {
|
|
1001
|
-
enable_sun?: boolean;
|
|
1002
|
-
enableMoon?: boolean;
|
|
1003
|
-
enable_lighting?: boolean;
|
|
1004
|
-
ground_atmosphere?: boolean;
|
|
1005
|
-
sky_atmosphere?: boolean;
|
|
1006
|
-
shadows?: boolean;
|
|
1007
|
-
shadowResolution?: 1024 | 2048 | 4096;
|
|
1008
|
-
softShadow?: boolean;
|
|
1009
|
-
shadowDarkness?: number;
|
|
1010
|
-
shadowMaximumDistance?: number;
|
|
1011
|
-
fog?: boolean;
|
|
1012
|
-
fog_density?: number;
|
|
1013
|
-
hue_shift?: number;
|
|
1014
|
-
brightness_shift?: number;
|
|
1015
|
-
surturation_shift?: number;
|
|
1016
|
-
skyboxBrightnessShift?: number;
|
|
1017
|
-
skyboxSurturationShift?: number;
|
|
1018
|
-
globeShadowDarkness?: number;
|
|
1019
|
-
globeImageBasedLighting?: boolean;
|
|
1020
|
-
globeBaseColor?: string;
|
|
1021
|
-
};
|
|
1022
|
-
timeline?: {
|
|
1023
|
-
animation?: boolean;
|
|
1024
|
-
visible?: boolean;
|
|
1025
|
-
current?: string;
|
|
1026
|
-
start?: string;
|
|
1027
|
-
stop?: string;
|
|
1028
|
-
stepType?: "rate" | "fixed";
|
|
1029
|
-
multiplier?: number;
|
|
1030
|
-
step?: number;
|
|
1031
|
-
rangeType?: "unbounded" | "clamped" | "bounced";
|
|
1032
|
-
};
|
|
1033
|
-
googleAnalytics?: {
|
|
1034
|
-
enableGA?: boolean;
|
|
1035
|
-
trackingId?: string;
|
|
1036
|
-
};
|
|
1037
|
-
theme?: {
|
|
1038
|
-
themeType?: "light" | "dark" | "forest" | "custom";
|
|
1039
|
-
themeTextColor?: string;
|
|
1040
|
-
themeSelectColor?: string;
|
|
1041
|
-
themeBackgroundColor?: string;
|
|
1042
|
-
};
|
|
1043
|
-
ambientOcclusion?: {
|
|
1044
|
-
enabled?: boolean;
|
|
1045
|
-
quality?: "low" | "medium" | "high" | "extreme";
|
|
1046
|
-
intensity?: number;
|
|
1047
|
-
ambientOcclusionOnly?: boolean;
|
|
1048
|
-
};
|
|
1049
|
-
light?: {
|
|
1050
|
-
lightType?: "sunLight" | "directionalLight";
|
|
1051
|
-
lightDirectionX?: number;
|
|
1052
|
-
lightDirectionY?: number;
|
|
1053
|
-
lightDirectionZ?: number;
|
|
1054
|
-
lightColor?: string;
|
|
1055
|
-
lightIntensity?: number;
|
|
1056
|
-
specularEnvironmentMaps?: string;
|
|
1057
|
-
sphericalHarmonicCoefficients?: [x: number, y: number, z: number][];
|
|
1058
|
-
imageBasedLightIntensity?: number;
|
|
1059
|
-
};
|
|
1060
|
-
render?: {
|
|
1061
|
-
antialias?: "low" | "medium" | "high" | "extreme";
|
|
1062
|
-
debugFramePerSecond?: boolean;
|
|
1063
|
-
};
|
|
1047
|
+
export declare type LightProperty = {
|
|
1048
|
+
type?: "sunLight" | "directionalLight";
|
|
1049
|
+
direction?: [x: number, y: number, z: number];
|
|
1050
|
+
color?: string;
|
|
1051
|
+
intensity?: number;
|
|
1064
1052
|
};
|
|
1065
1053
|
|
|
1066
1054
|
export declare type LookAtDestination = {
|
|
@@ -1087,7 +1075,7 @@ export declare type LUT = readonly ColorTuple[];
|
|
|
1087
1075
|
declare const Map_2: ForwardRefExoticComponent< {
|
|
1088
1076
|
engines?: Record<string, Engine> | undefined;
|
|
1089
1077
|
engine?: string | undefined;
|
|
1090
|
-
} & Omit<Props_2, "Feature" | "selectionReason" | "delegatedDataTypes" | "clusterComponent" | "selectedLayerId"> & Omit<EngineProps, "onLayerSelect" | "selectedLayerId" | "layerSelectionReason"> & Omit<SketchProps, "engineRef" | "layersRef" | "SketchComponent"> & {
|
|
1078
|
+
} & Omit<Props_2, "Feature" | "viewerProperty" | "selectionReason" | "delegatedDataTypes" | "clusterComponent" | "selectedLayerId"> & Omit<EngineProps, "onLayerSelect" | "selectedLayerId" | "layerSelectionReason"> & Omit<SketchProps, "engineRef" | "layersRef" | "SketchComponent"> & {
|
|
1091
1079
|
cursor?: CursorType | undefined;
|
|
1092
1080
|
} & RefAttributes<MapRef>>;
|
|
1093
1081
|
export { Map_2 as Map }
|
|
@@ -1177,6 +1165,10 @@ export declare type ModifiedCameraEventType = {
|
|
|
1177
1165
|
modifier: OverideKeyboardEventModifier;
|
|
1178
1166
|
};
|
|
1179
1167
|
|
|
1168
|
+
export declare type MoonProperty = {
|
|
1169
|
+
show?: boolean;
|
|
1170
|
+
};
|
|
1171
|
+
|
|
1180
1172
|
export declare type MouseEventCallback = (props: MouseEventProps) => void;
|
|
1181
1173
|
|
|
1182
1174
|
export declare type MouseEventCallbacks = {
|
|
@@ -1325,7 +1317,7 @@ declare type PropertyItem<T> = {
|
|
|
1325
1317
|
export declare type Props = {
|
|
1326
1318
|
engines?: Record<string, Engine>;
|
|
1327
1319
|
engine?: string;
|
|
1328
|
-
} & Omit<Props_2, "Feature" | "clusterComponent" | "selectionReason" | "delegatedDataTypes" | "selectedLayerId"> & Omit<EngineProps, "onLayerSelect" | "layerSelectionReason" | "selectedLayerId"> & Omit<SketchProps, "layersRef" | "engineRef" | "SketchComponent"> & {
|
|
1320
|
+
} & Omit<Props_2, "Feature" | "clusterComponent" | "selectionReason" | "delegatedDataTypes" | "selectedLayerId" | "viewerProperty"> & Omit<EngineProps, "onLayerSelect" | "layerSelectionReason" | "selectedLayerId"> & Omit<SketchProps, "layersRef" | "engineRef" | "SketchComponent"> & {
|
|
1329
1321
|
cursor?: CursorType;
|
|
1330
1322
|
};
|
|
1331
1323
|
|
|
@@ -1336,7 +1328,7 @@ declare type Props_2 = Omit<Props_3, "atomMap" | "isHidden" | "selectedLayerId">
|
|
|
1336
1328
|
reason?: LayerSelectionReason;
|
|
1337
1329
|
};
|
|
1338
1330
|
hiddenLayers?: string[];
|
|
1339
|
-
|
|
1331
|
+
viewerProperty?: ViewerProperty;
|
|
1340
1332
|
requestingRenderMode?: MutableRefObject<RequestingRenderMode>;
|
|
1341
1333
|
engineRef?: RefObject<EngineRef>;
|
|
1342
1334
|
onLayerSelect?: (layerId: string | undefined, featureId: string | undefined, layer: (() => Promise<ComputedLayer | undefined>) | undefined, reason: LayerSelectionReason | undefined, info: SelectedFeatureInfo | undefined) => void;
|
|
@@ -1353,7 +1345,7 @@ declare type Props_3 = {
|
|
|
1353
1345
|
isHidden?: (id: string) => boolean;
|
|
1354
1346
|
clusters?: Cluster[];
|
|
1355
1347
|
delegatedDataTypes?: DataType[];
|
|
1356
|
-
|
|
1348
|
+
viewerProperty?: ViewerProperty;
|
|
1357
1349
|
clusterComponent?: ClusterComponentType;
|
|
1358
1350
|
Feature?: Props_4["Feature"];
|
|
1359
1351
|
} & Omit<CommonProps, "isSelected" | "isHidden" | "selectedFeatureId">;
|
|
@@ -1363,7 +1355,7 @@ declare type Props_4 = {
|
|
|
1363
1355
|
atom?: Atom;
|
|
1364
1356
|
overrides?: Record<string, any>;
|
|
1365
1357
|
delegatedDataTypes?: DataType[];
|
|
1366
|
-
|
|
1358
|
+
viewerProperty?: ViewerProperty;
|
|
1367
1359
|
selectedFeatureId?: string;
|
|
1368
1360
|
/** Feature component should be injected by a map engine. */
|
|
1369
1361
|
Feature?: ComponentType<FeatureComponentProps>;
|
|
@@ -1386,6 +1378,11 @@ export declare type Rect = {
|
|
|
1386
1378
|
north: number;
|
|
1387
1379
|
};
|
|
1388
1380
|
|
|
1381
|
+
export declare type RenderPeropty = {
|
|
1382
|
+
antialias?: "low" | "medium" | "high" | "extreme";
|
|
1383
|
+
ambientOcclusion?: AmbientOcclusionProperty;
|
|
1384
|
+
};
|
|
1385
|
+
|
|
1389
1386
|
export declare type RequestingRenderMode = -1 | 0 | 1;
|
|
1390
1387
|
|
|
1391
1388
|
export declare type ResourceAppearance = {
|
|
@@ -1404,67 +1401,15 @@ export declare type ResourceAppearance = {
|
|
|
1404
1401
|
export declare type SceneMode = "3d" | "2d" | "columbus";
|
|
1405
1402
|
|
|
1406
1403
|
export declare type SceneProperty = {
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
tile_zoomLevel?: number[];
|
|
1417
|
-
tile_zoomLevelForURL?: number[];
|
|
1418
|
-
tile_opacity?: number;
|
|
1419
|
-
heatmap?: boolean;
|
|
1420
|
-
}[];
|
|
1421
|
-
tileLabels?: {
|
|
1422
|
-
id: string;
|
|
1423
|
-
labelType: "japan_gsi_optimal_bvmap";
|
|
1424
|
-
style: Record<string, any>;
|
|
1425
|
-
}[];
|
|
1426
|
-
terrain?: {
|
|
1427
|
-
terrain?: boolean;
|
|
1428
|
-
terrainType?: "cesium" | "arcgis" | "cesiumion";
|
|
1429
|
-
terrainCesiumIonAsset?: string;
|
|
1430
|
-
terrainCesiumIonAccessToken?: string;
|
|
1431
|
-
terrainCesiumIonUrl?: string;
|
|
1432
|
-
terrainExaggeration?: number;
|
|
1433
|
-
terrainExaggerationRelativeHeight?: number;
|
|
1434
|
-
depthTestAgainstTerrain?: boolean;
|
|
1435
|
-
};
|
|
1436
|
-
globeLighting?: {
|
|
1437
|
-
globeLighting?: boolean;
|
|
1438
|
-
};
|
|
1439
|
-
globeShadow?: {
|
|
1440
|
-
globeShadow?: boolean;
|
|
1441
|
-
};
|
|
1442
|
-
globeAtmosphere?: {
|
|
1443
|
-
globeAtmosphere?: boolean;
|
|
1444
|
-
globeAtmosphereIntensity?: number;
|
|
1445
|
-
};
|
|
1446
|
-
skyBox?: {
|
|
1447
|
-
skyBox?: boolean;
|
|
1448
|
-
};
|
|
1449
|
-
sun?: {
|
|
1450
|
-
sun?: boolean;
|
|
1451
|
-
};
|
|
1452
|
-
moon?: {
|
|
1453
|
-
moon?: boolean;
|
|
1454
|
-
};
|
|
1455
|
-
skyAtmosphere?: {
|
|
1456
|
-
skyAtmosphere?: boolean;
|
|
1457
|
-
skyAtmosphereIntensity?: number;
|
|
1458
|
-
};
|
|
1459
|
-
camera?: {
|
|
1460
|
-
camera?: Camera;
|
|
1461
|
-
allowEnterGround?: boolean;
|
|
1462
|
-
fov?: number;
|
|
1463
|
-
};
|
|
1464
|
-
render?: {
|
|
1465
|
-
showWireframe?: boolean;
|
|
1466
|
-
};
|
|
1467
|
-
} & LegacySceneProperty;
|
|
1404
|
+
backgroundColor?: string;
|
|
1405
|
+
mode?: SceneMode;
|
|
1406
|
+
verticalExaggeration?: number;
|
|
1407
|
+
verticalExaggerationRelativeHeight?: number;
|
|
1408
|
+
vr?: boolean;
|
|
1409
|
+
light?: LightProperty;
|
|
1410
|
+
shadow?: ShadowProperty;
|
|
1411
|
+
imageBasedLighting?: ImageBasedLighting;
|
|
1412
|
+
};
|
|
1468
1413
|
|
|
1469
1414
|
export declare type ScreenSpaceCameraControllerOptions = {
|
|
1470
1415
|
zoomEventTypes?: (OverideCameraEventType | ModifiedCameraEventType)[];
|
|
@@ -1499,6 +1444,19 @@ declare type SetTimeCommand = {
|
|
|
1499
1444
|
};
|
|
1500
1445
|
};
|
|
1501
1446
|
|
|
1447
|
+
export declare type ShadowMapProperty = {
|
|
1448
|
+
size?: 1024 | 2048 | 4096;
|
|
1449
|
+
softShadows?: boolean;
|
|
1450
|
+
darkness?: number;
|
|
1451
|
+
maximumDistance?: number;
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1454
|
+
export declare type ShadowProperty = {
|
|
1455
|
+
enabled?: boolean;
|
|
1456
|
+
darkness?: number;
|
|
1457
|
+
shadowMap?: ShadowMapProperty;
|
|
1458
|
+
};
|
|
1459
|
+
|
|
1502
1460
|
export declare type SketchAppearance = Partial<LayerAppearanceTypes>;
|
|
1503
1461
|
|
|
1504
1462
|
declare type SketchComponentProps = RequireExactlyOne<{
|
|
@@ -1553,6 +1511,25 @@ export declare type SketchRef = {
|
|
|
1553
1511
|
|
|
1554
1512
|
export declare type SketchType = "marker" | "polyline" | "circle" | "rectangle" | "polygon" | "extrudedCircle" | "extrudedRectangle" | "extrudedPolygon";
|
|
1555
1513
|
|
|
1514
|
+
export declare type SkyAtmosphereProperty = {
|
|
1515
|
+
show?: boolean;
|
|
1516
|
+
lightIntensity?: number;
|
|
1517
|
+
saturationShift?: number;
|
|
1518
|
+
brightnessShift?: number;
|
|
1519
|
+
};
|
|
1520
|
+
|
|
1521
|
+
export declare type SkyBoxProperty = {
|
|
1522
|
+
show?: boolean;
|
|
1523
|
+
};
|
|
1524
|
+
|
|
1525
|
+
export declare type SkyProperty = {
|
|
1526
|
+
skyBox?: SkyBoxProperty;
|
|
1527
|
+
sun?: SunProperty;
|
|
1528
|
+
moon?: MoonProperty;
|
|
1529
|
+
fog?: FogProperty;
|
|
1530
|
+
skyAtmosphere?: SkyAtmosphereProperty;
|
|
1531
|
+
};
|
|
1532
|
+
|
|
1556
1533
|
export declare type Spacing = {
|
|
1557
1534
|
bottom: number;
|
|
1558
1535
|
left: number;
|
|
@@ -1562,6 +1539,10 @@ export declare type Spacing = {
|
|
|
1562
1539
|
|
|
1563
1540
|
export declare type StyleExpression = ConditionsExpression | string;
|
|
1564
1541
|
|
|
1542
|
+
export declare type SunProperty = {
|
|
1543
|
+
show?: boolean;
|
|
1544
|
+
};
|
|
1545
|
+
|
|
1565
1546
|
export declare type Tag = {
|
|
1566
1547
|
id: string;
|
|
1567
1548
|
label: string;
|
|
@@ -1569,21 +1550,11 @@ export declare type Tag = {
|
|
|
1569
1550
|
};
|
|
1570
1551
|
|
|
1571
1552
|
export declare type TerrainProperty = {
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
terrainCesiumIonAsset?: string;
|
|
1578
|
-
terrainCesiumIonAccessToken?: string;
|
|
1579
|
-
terrainCesiumIonUrl?: string;
|
|
1580
|
-
terrainUrl?: string;
|
|
1581
|
-
terrainNormal?: boolean;
|
|
1582
|
-
heatmapType?: "custom";
|
|
1583
|
-
heatmapColorLUT?: LUT;
|
|
1584
|
-
heatmapMinHeight?: number;
|
|
1585
|
-
heatmapMaxHeight?: number;
|
|
1586
|
-
heatmapLogarithmic?: boolean;
|
|
1553
|
+
enabled?: boolean;
|
|
1554
|
+
type?: "cesium" | "arcgis" | "cesiumion";
|
|
1555
|
+
url?: string;
|
|
1556
|
+
normal?: boolean;
|
|
1557
|
+
heightMap?: HeightMapProperty;
|
|
1587
1558
|
};
|
|
1588
1559
|
|
|
1589
1560
|
export declare type TickEvent = (cb: TickEventCallback) => void;
|
|
@@ -1600,6 +1571,22 @@ declare type TickEventCallback_2 = (current: Date, clock: {
|
|
|
1600
1571
|
stop: Date;
|
|
1601
1572
|
}) => void;
|
|
1602
1573
|
|
|
1574
|
+
export declare type TileLabelProperty = {
|
|
1575
|
+
id: string;
|
|
1576
|
+
labelType: "japan_gsi_optimal_bvmap";
|
|
1577
|
+
style: Record<string, any>;
|
|
1578
|
+
};
|
|
1579
|
+
|
|
1580
|
+
export declare type TileProperty = {
|
|
1581
|
+
id: string;
|
|
1582
|
+
type?: string;
|
|
1583
|
+
url?: string;
|
|
1584
|
+
opacity?: number;
|
|
1585
|
+
zoomLevel?: number[];
|
|
1586
|
+
zoomLevelForURL?: number[];
|
|
1587
|
+
heatmap?: boolean;
|
|
1588
|
+
};
|
|
1589
|
+
|
|
1603
1590
|
export declare type TimeInterval = [start: Date, end?: Date];
|
|
1604
1591
|
|
|
1605
1592
|
export declare type Timeline = {
|
|
@@ -1619,7 +1606,7 @@ declare type TimelineCommit = (PlayCommand | PauseCommand | SetTimeCommand | Set
|
|
|
1619
1606
|
};
|
|
1620
1607
|
|
|
1621
1608
|
export declare type TimelineCommitter = {
|
|
1622
|
-
source: "
|
|
1609
|
+
source: "widgetContext" | "pluginAPI" | "featureResource" | "storyTimelineBlock" | "storyPage" | "initialize";
|
|
1623
1610
|
id?: string;
|
|
1624
1611
|
};
|
|
1625
1612
|
|
|
@@ -1683,8 +1670,6 @@ export declare type Undefinable<T extends object> = {
|
|
|
1683
1670
|
|
|
1684
1671
|
export declare function useGet<T>(value: T): () => T;
|
|
1685
1672
|
|
|
1686
|
-
export declare function useOverriddenProperty<T extends {}>(property: T | undefined): [T, (pluginId: string, property: T) => void];
|
|
1687
|
-
|
|
1688
1673
|
export declare const useVisualizer: () => RefObject<MapRef>;
|
|
1689
1674
|
|
|
1690
1675
|
export declare type ValueType = keyof ValueTypes;
|
|
@@ -1708,6 +1693,20 @@ export declare type ValueTypes = {
|
|
|
1708
1693
|
timeline: Timeline;
|
|
1709
1694
|
};
|
|
1710
1695
|
|
|
1696
|
+
export declare type ViewerProperty = {
|
|
1697
|
+
globe?: GlobeProperty;
|
|
1698
|
+
terrain?: TerrainProperty;
|
|
1699
|
+
scene?: SceneProperty;
|
|
1700
|
+
tiles?: TileProperty[];
|
|
1701
|
+
tileLabels?: TileLabelProperty[];
|
|
1702
|
+
sky?: SkyProperty;
|
|
1703
|
+
camera?: CameraProperty;
|
|
1704
|
+
render?: RenderPeropty;
|
|
1705
|
+
assets?: AssetsProperty;
|
|
1706
|
+
debug?: DebugProperty;
|
|
1707
|
+
indicator?: IndicatorProperty;
|
|
1708
|
+
};
|
|
1709
|
+
|
|
1711
1710
|
export declare type Viewport = {
|
|
1712
1711
|
width: number | undefined;
|
|
1713
1712
|
height: number | undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentType, useMemo, useCallback, ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
import LayerComponent, { type CommonProps, type Props as LayerProps } from "../Layer";
|
|
4
|
-
import type { Layer, Atom, Typography, DataType } from "../types";
|
|
4
|
+
import type { Layer, Atom, Typography, DataType, ViewerProperty } from "../types";
|
|
5
5
|
|
|
6
6
|
export type Props = {
|
|
7
7
|
layers?: Layer[];
|
|
@@ -14,7 +14,7 @@ export type Props = {
|
|
|
14
14
|
isHidden?: (id: string) => boolean;
|
|
15
15
|
clusters?: Cluster[];
|
|
16
16
|
delegatedDataTypes?: DataType[];
|
|
17
|
-
|
|
17
|
+
viewerProperty?: ViewerProperty;
|
|
18
18
|
clusterComponent?: ClusterComponentType;
|
|
19
19
|
Feature?: LayerProps["Feature"];
|
|
20
20
|
} & Omit<CommonProps, "isSelected" | "isHidden" | "selectedFeatureId">;
|
package/src/Map/Layer/index.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
ComputedFeature,
|
|
10
10
|
LayerSimple,
|
|
11
11
|
} from "../../mantle";
|
|
12
|
-
import {
|
|
12
|
+
import { ViewerProperty } from "../types";
|
|
13
13
|
|
|
14
14
|
import useHooks, { type Atom, type EvalFeature } from "./hooks";
|
|
15
15
|
|
|
@@ -29,7 +29,7 @@ export type CommonProps = {
|
|
|
29
29
|
|
|
30
30
|
export type FeatureComponentProps = {
|
|
31
31
|
layer: ComputedLayer;
|
|
32
|
-
|
|
32
|
+
viewerProperty?: ViewerProperty;
|
|
33
33
|
onFeatureRequest?: (range: DataRange) => void;
|
|
34
34
|
onLayerFetch?: (value: Partial<Pick<LayerSimple, "properties">>) => void;
|
|
35
35
|
onFeatureFetch?: (features: Feature[]) => void;
|
|
@@ -44,7 +44,7 @@ export type Props = {
|
|
|
44
44
|
atom?: Atom;
|
|
45
45
|
overrides?: Record<string, any>;
|
|
46
46
|
delegatedDataTypes?: DataType[];
|
|
47
|
-
|
|
47
|
+
viewerProperty?: ViewerProperty;
|
|
48
48
|
selectedFeatureId?: string;
|
|
49
49
|
/** Feature component should be injected by a map engine. */
|
|
50
50
|
Feature?: ComponentType<FeatureComponentProps>;
|
package/src/Map/Layers/index.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { forwardRef, RefObject, type ForwardRefRenderFunction, type MutableRefOb
|
|
|
2
2
|
|
|
3
3
|
import { SelectedFeatureInfo } from "../../mantle";
|
|
4
4
|
import ClusteredLayers, { type Props as ClusteredLayerProps } from "../ClusteredLayers";
|
|
5
|
-
import type { ComputedLayer, EngineRef, RequestingRenderMode } from "../types";
|
|
5
|
+
import type { ComputedLayer, EngineRef, RequestingRenderMode, ViewerProperty } from "../types";
|
|
6
6
|
|
|
7
7
|
import useHooks, { LayerSelectionReason, type Ref } from "./hooks";
|
|
8
8
|
|
|
@@ -36,7 +36,7 @@ export type Props = Omit<ClusteredLayerProps, "atomMap" | "isHidden" | "selected
|
|
|
36
36
|
reason?: LayerSelectionReason;
|
|
37
37
|
};
|
|
38
38
|
hiddenLayers?: string[];
|
|
39
|
-
|
|
39
|
+
viewerProperty?: ViewerProperty;
|
|
40
40
|
requestingRenderMode?: MutableRefObject<RequestingRenderMode>;
|
|
41
41
|
engineRef?: RefObject<EngineRef>;
|
|
42
42
|
onLayerSelect?: (
|
package/src/Map/hooks.ts
CHANGED
|
@@ -9,7 +9,6 @@ import type {
|
|
|
9
9
|
LayerSelectionReason,
|
|
10
10
|
ComputedLayer,
|
|
11
11
|
RequestingRenderMode,
|
|
12
|
-
SceneProperty,
|
|
13
12
|
SketchRef,
|
|
14
13
|
} from "./types";
|
|
15
14
|
import useTimelineManager, { TimelineManagerRef } from "./useTimelineManager";
|
|
@@ -24,13 +23,11 @@ export const REQUEST_RENDER_ONCE = 1;
|
|
|
24
23
|
|
|
25
24
|
export default function ({
|
|
26
25
|
ref,
|
|
27
|
-
sceneProperty,
|
|
28
26
|
timelineManagerRef,
|
|
29
27
|
cursor,
|
|
30
28
|
onLayerSelect,
|
|
31
29
|
}: {
|
|
32
30
|
ref: Ref<MapRef>;
|
|
33
|
-
sceneProperty?: SceneProperty;
|
|
34
31
|
timelineManagerRef?: TimelineManagerRef;
|
|
35
32
|
cursor?: CursorType;
|
|
36
33
|
onLayerSelect?: (
|
|
@@ -104,7 +101,6 @@ export default function ({
|
|
|
104
101
|
);
|
|
105
102
|
|
|
106
103
|
useTimelineManager({
|
|
107
|
-
init: sceneProperty?.timeline,
|
|
108
104
|
engineRef,
|
|
109
105
|
timelineManagerRef,
|
|
110
106
|
});
|