@reearth/core 0.0.7-alpha.0 → 0.0.7-alpha.2
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 +8865 -8890
- package/dist/core.umd.cjs +74 -74
- package/dist/index.d.ts +216 -212
- 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/Sketch/hooks.ts +46 -66
- package/src/Map/Sketch/index.tsx +2 -24
- package/src/Map/Sketch/preset.ts +2 -0
- package/src/Map/Sketch/types.ts +31 -0
- package/src/Map/hooks.ts +0 -4
- package/src/Map/index.tsx +8 -5
- package/src/Map/ref.ts +3 -7
- package/src/Map/types/index.ts +34 -216
- package/src/Map/types/viewerProperty.ts +215 -0
- package/src/Map/useTimelineManager.ts +5 -3
- 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 +135 -0
- package/src/engines/Cesium/{cameraLimiter.ts → hooks/useCameraLimiter.ts} +22 -45
- package/src/engines/Cesium/{useEngineRef.test.tsx → hooks/useEngineRef.test.tsx} +38 -34
- package/src/engines/Cesium/{useEngineRef.ts → hooks/useEngineRef.ts} +43 -41
- 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 +129 -365
- package/src/engines/Cesium/index.stories.tsx +1 -1
- package/src/engines/Cesium/index.tsx +60 -62
- package/src/engines/index.ts +1 -1
- package/src/mantle/compat/types.ts +7 -7
- /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
|
+
terrain?: {
|
|
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;
|
|
@@ -110,23 +137,28 @@ export declare type CameraOptions = {
|
|
|
110
137
|
/** Represents the camera position and state */
|
|
111
138
|
export declare type CameraPosition = {
|
|
112
139
|
/** degrees */
|
|
113
|
-
lat
|
|
140
|
+
lat?: number;
|
|
114
141
|
/** degrees */
|
|
115
|
-
lng
|
|
142
|
+
lng?: number;
|
|
116
143
|
/** meters */
|
|
117
|
-
height
|
|
144
|
+
height?: number;
|
|
118
145
|
/** radians */
|
|
119
|
-
heading
|
|
146
|
+
heading?: number;
|
|
120
147
|
/** radians */
|
|
121
|
-
pitch
|
|
148
|
+
pitch?: number;
|
|
122
149
|
/** radians */
|
|
123
|
-
roll
|
|
150
|
+
roll?: number;
|
|
124
151
|
/** Field of view expressed in radians */
|
|
125
|
-
fov
|
|
152
|
+
fov?: number;
|
|
126
153
|
/** Aspect ratio of frustum */
|
|
127
154
|
aspectRatio?: number;
|
|
128
155
|
};
|
|
129
156
|
|
|
157
|
+
export declare type CameraProperty = {
|
|
158
|
+
allowEnterGround?: boolean;
|
|
159
|
+
limiter?: CameraLimiterProperty;
|
|
160
|
+
};
|
|
161
|
+
|
|
130
162
|
export declare type Cesium3DTilesAppearance = {
|
|
131
163
|
show?: boolean;
|
|
132
164
|
color?: string;
|
|
@@ -285,8 +317,6 @@ declare type CoreContext = {
|
|
|
285
317
|
};
|
|
286
318
|
selectedComputedFeature?: ComputedFeature | undefined;
|
|
287
319
|
viewport?: Viewport;
|
|
288
|
-
overriddenSceneProperty?: SceneProperty;
|
|
289
|
-
overrideSceneProperty?: (pluginId: string, property: SceneProperty) => void;
|
|
290
320
|
handleCameraForceHorizontalRollChange?: (enable?: boolean) => void;
|
|
291
321
|
handleInteractionModeChange?: (mode?: InteractionModeType | undefined) => void;
|
|
292
322
|
onSketchPluginFeatureCreate?: (cb: SketchEventCallback) => void;
|
|
@@ -309,9 +339,10 @@ export declare type CoreVisualizerProps = {
|
|
|
309
339
|
engine?: EngineType;
|
|
310
340
|
isBuilt?: boolean;
|
|
311
341
|
isEditable?: boolean;
|
|
312
|
-
|
|
342
|
+
viewerProperty?: ViewerProperty;
|
|
313
343
|
layers?: Layer[];
|
|
314
344
|
clusters?: Cluster[];
|
|
345
|
+
time?: string | Date;
|
|
315
346
|
camera?: Camera;
|
|
316
347
|
interactionMode?: InteractionModeType;
|
|
317
348
|
shouldRender?: boolean;
|
|
@@ -371,6 +402,11 @@ export declare type DataRange = {
|
|
|
371
402
|
|
|
372
403
|
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
404
|
|
|
405
|
+
export declare type DebugProperty = {
|
|
406
|
+
showGlobeWireframe?: boolean;
|
|
407
|
+
showFramesPerSecond?: boolean;
|
|
408
|
+
};
|
|
409
|
+
|
|
374
410
|
export declare type DefaultInfobox = {
|
|
375
411
|
title?: string;
|
|
376
412
|
content: {
|
|
@@ -385,6 +421,14 @@ export declare type DefaultInfobox = {
|
|
|
385
421
|
};
|
|
386
422
|
};
|
|
387
423
|
|
|
424
|
+
export declare type ElevationHeatMapProperty = {
|
|
425
|
+
type?: "custom";
|
|
426
|
+
colorLUT?: LUT;
|
|
427
|
+
minHeight?: number;
|
|
428
|
+
maxHeight?: number;
|
|
429
|
+
logarithmic?: boolean;
|
|
430
|
+
};
|
|
431
|
+
|
|
388
432
|
export declare type EllipseAppearance = {
|
|
389
433
|
show?: boolean;
|
|
390
434
|
heightReference?: "none" | "clamp" | "relative";
|
|
@@ -428,7 +472,8 @@ export declare type EngineProps = {
|
|
|
428
472
|
style?: CSSProperties;
|
|
429
473
|
isEditable?: boolean;
|
|
430
474
|
isBuilt?: boolean;
|
|
431
|
-
property?:
|
|
475
|
+
property?: ViewerProperty;
|
|
476
|
+
time?: string | Date;
|
|
432
477
|
camera?: Camera;
|
|
433
478
|
cameraForceHorizontalRoll?: boolean;
|
|
434
479
|
small?: boolean;
|
|
@@ -475,7 +520,7 @@ export declare type EngineRef = {
|
|
|
475
520
|
getLocationFromScreen: (x: number, y: number, withTerrain?: boolean) => LatLngHeight | undefined;
|
|
476
521
|
sampleTerrainHeight: (lng: number, lat: number) => Promise<number | undefined>;
|
|
477
522
|
computeGlobeHeight: (lng: number, lat: number, height?: number) => number | undefined;
|
|
478
|
-
getGlobeHeight: () =>
|
|
523
|
+
getGlobeHeight: () => number | undefined;
|
|
479
524
|
toXYZ: (lng: number, lat: number, height: number, options?: {
|
|
480
525
|
useGlobeEllipsoid?: boolean;
|
|
481
526
|
}) => [x: number, y: number, z: number] | undefined;
|
|
@@ -655,7 +700,7 @@ export declare const FEATURE_FLAGS: {
|
|
|
655
700
|
|
|
656
701
|
export declare type FeatureComponentProps = {
|
|
657
702
|
layer: ComputedLayer;
|
|
658
|
-
|
|
703
|
+
viewerProperty?: ViewerProperty;
|
|
659
704
|
onFeatureRequest?: (range: DataRange) => void;
|
|
660
705
|
onLayerFetch?: (value: Partial<Pick<LayerSimple, "properties">>) => void;
|
|
661
706
|
onFeatureFetch?: (features: Feature[]) => void;
|
|
@@ -686,6 +731,11 @@ export declare type FlyToDestination = {
|
|
|
686
731
|
fov?: number;
|
|
687
732
|
};
|
|
688
733
|
|
|
734
|
+
export declare type FogProperty = {
|
|
735
|
+
enabled?: boolean;
|
|
736
|
+
density?: number;
|
|
737
|
+
};
|
|
738
|
+
|
|
689
739
|
export declare type FrustumAppearance = {
|
|
690
740
|
show?: boolean;
|
|
691
741
|
color?: string;
|
|
@@ -721,6 +771,21 @@ declare const globalDataFeaturesCache: {
|
|
|
721
771
|
getAll: Atom_2<(key: string) => Feature[][] | undefined>;
|
|
722
772
|
};
|
|
723
773
|
|
|
774
|
+
export declare type GlobeAtmosphereProperty = {
|
|
775
|
+
enabled?: boolean;
|
|
776
|
+
lightIntensity?: number;
|
|
777
|
+
brightnessShift?: number;
|
|
778
|
+
hueShift?: number;
|
|
779
|
+
saturationShift?: number;
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
export declare type GlobeProperty = {
|
|
783
|
+
baseColor?: string;
|
|
784
|
+
enableLighting?: boolean;
|
|
785
|
+
atmosphere?: GlobeAtmosphereProperty;
|
|
786
|
+
depthTestAgainstTerrain?: boolean;
|
|
787
|
+
};
|
|
788
|
+
|
|
724
789
|
export declare function guessType(url: string | undefined): DataType | undefined;
|
|
725
790
|
|
|
726
791
|
export declare type HeatMapAppearance = {
|
|
@@ -739,7 +804,18 @@ export declare type HeatMapAppearance = {
|
|
|
739
804
|
logarithmic?: boolean;
|
|
740
805
|
};
|
|
741
806
|
|
|
742
|
-
export declare type
|
|
807
|
+
export declare type ImageBasedLighting = {
|
|
808
|
+
enabled?: boolean;
|
|
809
|
+
intensity?: number;
|
|
810
|
+
specularEnvironmentMaps?: string;
|
|
811
|
+
sphericalHarmonicCoefficients?: [number, number, number][];
|
|
812
|
+
};
|
|
813
|
+
|
|
814
|
+
export declare type IndicatorProperty = {
|
|
815
|
+
type?: "default" | "crosshair" | "custom";
|
|
816
|
+
image?: string;
|
|
817
|
+
imageScale?: number;
|
|
818
|
+
};
|
|
743
819
|
|
|
744
820
|
declare type Infobox<BP = any> = {
|
|
745
821
|
featureId?: string;
|
|
@@ -967,100 +1043,11 @@ export declare type LegacyPhotooverlayAppearance = {
|
|
|
967
1043
|
far?: number;
|
|
968
1044
|
};
|
|
969
1045
|
|
|
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
|
-
};
|
|
1046
|
+
export declare type LightProperty = {
|
|
1047
|
+
type?: "sunLight" | "directionalLight";
|
|
1048
|
+
direction?: [x: number, y: number, z: number];
|
|
1049
|
+
color?: string;
|
|
1050
|
+
intensity?: number;
|
|
1064
1051
|
};
|
|
1065
1052
|
|
|
1066
1053
|
export declare type LookAtDestination = {
|
|
@@ -1087,7 +1074,7 @@ export declare type LUT = readonly ColorTuple[];
|
|
|
1087
1074
|
declare const Map_2: ForwardRefExoticComponent< {
|
|
1088
1075
|
engines?: Record<string, Engine> | undefined;
|
|
1089
1076
|
engine?: string | undefined;
|
|
1090
|
-
} & Omit<Props_2, "Feature" | "selectionReason" | "delegatedDataTypes" | "clusterComponent" | "selectedLayerId"> & Omit<EngineProps, "onLayerSelect" | "selectedLayerId" | "layerSelectionReason"> & Omit<SketchProps, "engineRef" | "layersRef" | "SketchComponent"> & {
|
|
1077
|
+
} & Omit<Props_2, "Feature" | "viewerProperty" | "selectionReason" | "delegatedDataTypes" | "clusterComponent" | "selectedLayerId"> & Omit<EngineProps, "onLayerSelect" | "selectedLayerId" | "layerSelectionReason"> & Omit<SketchProps, "engineRef" | "layersRef" | "SketchComponent"> & {
|
|
1091
1078
|
cursor?: CursorType | undefined;
|
|
1092
1079
|
} & RefAttributes<MapRef>>;
|
|
1093
1080
|
export { Map_2 as Map }
|
|
@@ -1177,6 +1164,10 @@ export declare type ModifiedCameraEventType = {
|
|
|
1177
1164
|
modifier: OverideKeyboardEventModifier;
|
|
1178
1165
|
};
|
|
1179
1166
|
|
|
1167
|
+
export declare type MoonProperty = {
|
|
1168
|
+
show?: boolean;
|
|
1169
|
+
};
|
|
1170
|
+
|
|
1180
1171
|
export declare type MouseEventCallback = (props: MouseEventProps) => void;
|
|
1181
1172
|
|
|
1182
1173
|
export declare type MouseEventCallbacks = {
|
|
@@ -1185,18 +1176,18 @@ export declare type MouseEventCallbacks = {
|
|
|
1185
1176
|
|
|
1186
1177
|
export declare type MouseEventHandles = {
|
|
1187
1178
|
onClick: (fn: MouseEvents["click"]) => void;
|
|
1188
|
-
onDoubleClick: (fn: MouseEvents["
|
|
1189
|
-
onMouseDown: (fn: MouseEvents["
|
|
1190
|
-
onMouseUp: (fn: MouseEvents["
|
|
1191
|
-
onRightClick: (fn: MouseEvents["
|
|
1192
|
-
onRightDown: (fn: MouseEvents["
|
|
1193
|
-
onRightUp: (fn: MouseEvents["
|
|
1194
|
-
onMiddleClick: (fn: MouseEvents["
|
|
1195
|
-
onMiddleDown: (fn: MouseEvents["
|
|
1196
|
-
onMiddleUp: (fn: MouseEvents["
|
|
1197
|
-
onMouseMove: (fn: MouseEvents["
|
|
1198
|
-
onMouseEnter: (fn: MouseEvents["
|
|
1199
|
-
onMouseLeave: (fn: MouseEvents["
|
|
1179
|
+
onDoubleClick: (fn: MouseEvents["doubleClick"]) => void;
|
|
1180
|
+
onMouseDown: (fn: MouseEvents["mouseDown"]) => void;
|
|
1181
|
+
onMouseUp: (fn: MouseEvents["mouseUp"]) => void;
|
|
1182
|
+
onRightClick: (fn: MouseEvents["rightClick"]) => void;
|
|
1183
|
+
onRightDown: (fn: MouseEvents["rightDown"]) => void;
|
|
1184
|
+
onRightUp: (fn: MouseEvents["rightUp"]) => void;
|
|
1185
|
+
onMiddleClick: (fn: MouseEvents["middleClick"]) => void;
|
|
1186
|
+
onMiddleDown: (fn: MouseEvents["middleDown"]) => void;
|
|
1187
|
+
onMiddleUp: (fn: MouseEvents["middleUp"]) => void;
|
|
1188
|
+
onMouseMove: (fn: MouseEvents["mouseMove"]) => void;
|
|
1189
|
+
onMouseEnter: (fn: MouseEvents["mouseEnter"]) => void;
|
|
1190
|
+
onMouseLeave: (fn: MouseEvents["mouseLeave"]) => void;
|
|
1200
1191
|
onWheel: (fn: MouseEvents["wheel"]) => void;
|
|
1201
1192
|
};
|
|
1202
1193
|
|
|
@@ -1216,7 +1207,7 @@ export declare type MouseEvents = {
|
|
|
1216
1207
|
wheel: MouseWheelEventCallback;
|
|
1217
1208
|
};
|
|
1218
1209
|
|
|
1219
|
-
export declare type MouseEventTypes = "click" | "
|
|
1210
|
+
export declare type MouseEventTypes = "click" | "doubleClick" | "mouseDown" | "mouseUp" | "rightClick" | "rightDown" | "rightUp" | "middleClick" | "middleDown" | "middleUp" | "mouseMove" | "mouseEnter" | "mouseLeave" | "wheel";
|
|
1220
1211
|
|
|
1221
1212
|
export declare type MouseWheelEventCallback = (props: MouseEventProps) => void;
|
|
1222
1213
|
|
|
@@ -1325,7 +1316,7 @@ declare type PropertyItem<T> = {
|
|
|
1325
1316
|
export declare type Props = {
|
|
1326
1317
|
engines?: Record<string, Engine>;
|
|
1327
1318
|
engine?: string;
|
|
1328
|
-
} & Omit<Props_2, "Feature" | "clusterComponent" | "selectionReason" | "delegatedDataTypes" | "selectedLayerId"> & Omit<EngineProps, "onLayerSelect" | "layerSelectionReason" | "selectedLayerId"> & Omit<SketchProps, "layersRef" | "engineRef" | "SketchComponent"> & {
|
|
1319
|
+
} & Omit<Props_2, "Feature" | "clusterComponent" | "selectionReason" | "delegatedDataTypes" | "selectedLayerId" | "viewerProperty"> & Omit<EngineProps, "onLayerSelect" | "layerSelectionReason" | "selectedLayerId"> & Omit<SketchProps, "layersRef" | "engineRef" | "SketchComponent"> & {
|
|
1329
1320
|
cursor?: CursorType;
|
|
1330
1321
|
};
|
|
1331
1322
|
|
|
@@ -1336,7 +1327,7 @@ declare type Props_2 = Omit<Props_3, "atomMap" | "isHidden" | "selectedLayerId">
|
|
|
1336
1327
|
reason?: LayerSelectionReason;
|
|
1337
1328
|
};
|
|
1338
1329
|
hiddenLayers?: string[];
|
|
1339
|
-
|
|
1330
|
+
viewerProperty?: ViewerProperty;
|
|
1340
1331
|
requestingRenderMode?: MutableRefObject<RequestingRenderMode>;
|
|
1341
1332
|
engineRef?: RefObject<EngineRef>;
|
|
1342
1333
|
onLayerSelect?: (layerId: string | undefined, featureId: string | undefined, layer: (() => Promise<ComputedLayer | undefined>) | undefined, reason: LayerSelectionReason | undefined, info: SelectedFeatureInfo | undefined) => void;
|
|
@@ -1353,7 +1344,7 @@ declare type Props_3 = {
|
|
|
1353
1344
|
isHidden?: (id: string) => boolean;
|
|
1354
1345
|
clusters?: Cluster[];
|
|
1355
1346
|
delegatedDataTypes?: DataType[];
|
|
1356
|
-
|
|
1347
|
+
viewerProperty?: ViewerProperty;
|
|
1357
1348
|
clusterComponent?: ClusterComponentType;
|
|
1358
1349
|
Feature?: Props_4["Feature"];
|
|
1359
1350
|
} & Omit<CommonProps, "isSelected" | "isHidden" | "selectedFeatureId">;
|
|
@@ -1363,7 +1354,7 @@ declare type Props_4 = {
|
|
|
1363
1354
|
atom?: Atom;
|
|
1364
1355
|
overrides?: Record<string, any>;
|
|
1365
1356
|
delegatedDataTypes?: DataType[];
|
|
1366
|
-
|
|
1357
|
+
viewerProperty?: ViewerProperty;
|
|
1367
1358
|
selectedFeatureId?: string;
|
|
1368
1359
|
/** Feature component should be injected by a map engine. */
|
|
1369
1360
|
Feature?: ComponentType<FeatureComponentProps>;
|
|
@@ -1386,6 +1377,11 @@ export declare type Rect = {
|
|
|
1386
1377
|
north: number;
|
|
1387
1378
|
};
|
|
1388
1379
|
|
|
1380
|
+
export declare type RenderPeropty = {
|
|
1381
|
+
antialias?: "low" | "medium" | "high" | "extreme";
|
|
1382
|
+
ambientOcclusion?: AmbientOcclusionProperty;
|
|
1383
|
+
};
|
|
1384
|
+
|
|
1389
1385
|
export declare type RequestingRenderMode = -1 | 0 | 1;
|
|
1390
1386
|
|
|
1391
1387
|
export declare type ResourceAppearance = {
|
|
@@ -1404,67 +1400,15 @@ export declare type ResourceAppearance = {
|
|
|
1404
1400
|
export declare type SceneMode = "3d" | "2d" | "columbus";
|
|
1405
1401
|
|
|
1406
1402
|
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;
|
|
1403
|
+
backgroundColor?: string;
|
|
1404
|
+
mode?: SceneMode;
|
|
1405
|
+
verticalExaggeration?: number;
|
|
1406
|
+
verticalExaggerationRelativeHeight?: number;
|
|
1407
|
+
vr?: boolean;
|
|
1408
|
+
light?: LightProperty;
|
|
1409
|
+
shadow?: ShadowProperty;
|
|
1410
|
+
imageBasedLighting?: ImageBasedLighting;
|
|
1411
|
+
};
|
|
1468
1412
|
|
|
1469
1413
|
export declare type ScreenSpaceCameraControllerOptions = {
|
|
1470
1414
|
zoomEventTypes?: (OverideCameraEventType | ModifiedCameraEventType)[];
|
|
@@ -1499,6 +1443,19 @@ declare type SetTimeCommand = {
|
|
|
1499
1443
|
};
|
|
1500
1444
|
};
|
|
1501
1445
|
|
|
1446
|
+
export declare type ShadowMapProperty = {
|
|
1447
|
+
size?: 1024 | 2048 | 4096;
|
|
1448
|
+
softShadows?: boolean;
|
|
1449
|
+
darkness?: number;
|
|
1450
|
+
maximumDistance?: number;
|
|
1451
|
+
};
|
|
1452
|
+
|
|
1453
|
+
export declare type ShadowProperty = {
|
|
1454
|
+
enabled?: boolean;
|
|
1455
|
+
darkness?: number;
|
|
1456
|
+
shadowMap?: ShadowMapProperty;
|
|
1457
|
+
};
|
|
1458
|
+
|
|
1502
1459
|
export declare type SketchAppearance = Partial<LayerAppearanceTypes>;
|
|
1503
1460
|
|
|
1504
1461
|
declare type SketchComponentProps = RequireExactlyOne<{
|
|
@@ -1527,6 +1484,16 @@ export declare type SketchFeature = Feature_2<Polygon_2 | MultiPolygon | Point |
|
|
|
1527
1484
|
extrudedHeight: number;
|
|
1528
1485
|
}>;
|
|
1529
1486
|
|
|
1487
|
+
export declare type SketchOptions = {
|
|
1488
|
+
color?: string;
|
|
1489
|
+
appearance?: SketchAppearance;
|
|
1490
|
+
dataOnly?: boolean;
|
|
1491
|
+
disableShadow?: boolean;
|
|
1492
|
+
enableRelativeHeight?: boolean;
|
|
1493
|
+
rightClickToAbort?: boolean;
|
|
1494
|
+
autoResetInteractionMode?: boolean;
|
|
1495
|
+
};
|
|
1496
|
+
|
|
1530
1497
|
export declare type SketchProps = {
|
|
1531
1498
|
layersRef: RefObject<LayersRef>;
|
|
1532
1499
|
engineRef: RefObject<EngineRef>;
|
|
@@ -1541,18 +1508,33 @@ export declare type SketchProps = {
|
|
|
1541
1508
|
};
|
|
1542
1509
|
|
|
1543
1510
|
export declare type SketchRef = {
|
|
1511
|
+
getType: () => SketchType | undefined;
|
|
1544
1512
|
setType: (type: SketchType | undefined, from?: "editor" | "plugin") => void;
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
disableShadow: (disable: boolean) => void;
|
|
1548
|
-
enableRelativeHeight: (enable: boolean) => void;
|
|
1549
|
-
createDataOnly: (dataOnly: boolean) => void;
|
|
1550
|
-
allowRightClickToAbort: (allow: boolean) => void;
|
|
1551
|
-
allowAutoResetInteractionMode: (allow: boolean) => void;
|
|
1513
|
+
getOptions: () => SketchOptions;
|
|
1514
|
+
overrideOptions: (options: SketchOptions) => void;
|
|
1552
1515
|
};
|
|
1553
1516
|
|
|
1554
1517
|
export declare type SketchType = "marker" | "polyline" | "circle" | "rectangle" | "polygon" | "extrudedCircle" | "extrudedRectangle" | "extrudedPolygon";
|
|
1555
1518
|
|
|
1519
|
+
export declare type SkyAtmosphereProperty = {
|
|
1520
|
+
show?: boolean;
|
|
1521
|
+
lightIntensity?: number;
|
|
1522
|
+
saturationShift?: number;
|
|
1523
|
+
brightnessShift?: number;
|
|
1524
|
+
};
|
|
1525
|
+
|
|
1526
|
+
export declare type SkyBoxProperty = {
|
|
1527
|
+
show?: boolean;
|
|
1528
|
+
};
|
|
1529
|
+
|
|
1530
|
+
export declare type SkyProperty = {
|
|
1531
|
+
skyBox?: SkyBoxProperty;
|
|
1532
|
+
sun?: SunProperty;
|
|
1533
|
+
moon?: MoonProperty;
|
|
1534
|
+
fog?: FogProperty;
|
|
1535
|
+
skyAtmosphere?: SkyAtmosphereProperty;
|
|
1536
|
+
};
|
|
1537
|
+
|
|
1556
1538
|
export declare type Spacing = {
|
|
1557
1539
|
bottom: number;
|
|
1558
1540
|
left: number;
|
|
@@ -1562,6 +1544,10 @@ export declare type Spacing = {
|
|
|
1562
1544
|
|
|
1563
1545
|
export declare type StyleExpression = ConditionsExpression | string;
|
|
1564
1546
|
|
|
1547
|
+
export declare type SunProperty = {
|
|
1548
|
+
show?: boolean;
|
|
1549
|
+
};
|
|
1550
|
+
|
|
1565
1551
|
export declare type Tag = {
|
|
1566
1552
|
id: string;
|
|
1567
1553
|
label: string;
|
|
@@ -1569,21 +1555,11 @@ export declare type Tag = {
|
|
|
1569
1555
|
};
|
|
1570
1556
|
|
|
1571
1557
|
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;
|
|
1558
|
+
enabled?: boolean;
|
|
1559
|
+
type?: "cesium" | "arcgis" | "cesiumion";
|
|
1560
|
+
url?: string;
|
|
1561
|
+
normal?: boolean;
|
|
1562
|
+
elevationHeatMap?: ElevationHeatMapProperty;
|
|
1587
1563
|
};
|
|
1588
1564
|
|
|
1589
1565
|
export declare type TickEvent = (cb: TickEventCallback) => void;
|
|
@@ -1600,6 +1576,22 @@ declare type TickEventCallback_2 = (current: Date, clock: {
|
|
|
1600
1576
|
stop: Date;
|
|
1601
1577
|
}) => void;
|
|
1602
1578
|
|
|
1579
|
+
export declare type TileLabelProperty = {
|
|
1580
|
+
id: string;
|
|
1581
|
+
labelType: "japan_gsi_optimal_bvmap";
|
|
1582
|
+
style: Record<string, any>;
|
|
1583
|
+
};
|
|
1584
|
+
|
|
1585
|
+
export declare type TileProperty = {
|
|
1586
|
+
id: string;
|
|
1587
|
+
type?: string;
|
|
1588
|
+
url?: string;
|
|
1589
|
+
opacity?: number;
|
|
1590
|
+
zoomLevel?: number[];
|
|
1591
|
+
zoomLevelForURL?: number[];
|
|
1592
|
+
heatmap?: boolean;
|
|
1593
|
+
};
|
|
1594
|
+
|
|
1603
1595
|
export declare type TimeInterval = [start: Date, end?: Date];
|
|
1604
1596
|
|
|
1605
1597
|
export declare type Timeline = {
|
|
@@ -1619,7 +1611,7 @@ declare type TimelineCommit = (PlayCommand | PauseCommand | SetTimeCommand | Set
|
|
|
1619
1611
|
};
|
|
1620
1612
|
|
|
1621
1613
|
export declare type TimelineCommitter = {
|
|
1622
|
-
source: "
|
|
1614
|
+
source: "widgetContext" | "pluginAPI" | "featureResource" | "storyTimelineBlock" | "storyPage" | "initialize";
|
|
1623
1615
|
id?: string;
|
|
1624
1616
|
};
|
|
1625
1617
|
|
|
@@ -1683,8 +1675,6 @@ export declare type Undefinable<T extends object> = {
|
|
|
1683
1675
|
|
|
1684
1676
|
export declare function useGet<T>(value: T): () => T;
|
|
1685
1677
|
|
|
1686
|
-
export declare function useOverriddenProperty<T extends {}>(property: T | undefined): [T, (pluginId: string, property: T) => void];
|
|
1687
|
-
|
|
1688
1678
|
export declare const useVisualizer: () => RefObject<MapRef>;
|
|
1689
1679
|
|
|
1690
1680
|
export declare type ValueType = keyof ValueTypes;
|
|
@@ -1708,6 +1698,20 @@ export declare type ValueTypes = {
|
|
|
1708
1698
|
timeline: Timeline;
|
|
1709
1699
|
};
|
|
1710
1700
|
|
|
1701
|
+
export declare type ViewerProperty = {
|
|
1702
|
+
globe?: GlobeProperty;
|
|
1703
|
+
terrain?: TerrainProperty;
|
|
1704
|
+
scene?: SceneProperty;
|
|
1705
|
+
tiles?: TileProperty[];
|
|
1706
|
+
tileLabels?: TileLabelProperty[];
|
|
1707
|
+
sky?: SkyProperty;
|
|
1708
|
+
camera?: CameraProperty;
|
|
1709
|
+
render?: RenderPeropty;
|
|
1710
|
+
assets?: AssetsProperty;
|
|
1711
|
+
debug?: DebugProperty;
|
|
1712
|
+
indicator?: IndicatorProperty;
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1711
1715
|
export declare type Viewport = {
|
|
1712
1716
|
width: number | undefined;
|
|
1713
1717
|
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">;
|