@reearth/core 0.0.7-alpha.63 → 0.0.7-alpha.64

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/index.d.ts CHANGED
@@ -6,11 +6,11 @@ import { CSSProperties } from 'react';
6
6
  import { Feature as Feature_2 } from 'geojson';
7
7
  import { ForwardRefExoticComponent } from 'react';
8
8
  import { LineString } from 'geojson';
9
- import { MemoExoticComponent } from 'react';
10
9
  import { MultiLineString } from 'geojson';
11
10
  import { MultiPoint } from 'geojson';
12
11
  import { MultiPolygon } from 'geojson';
13
12
  import { MutableRefObject } from 'react';
13
+ import { NamedExoticComponent } from 'react';
14
14
  import { Point } from 'geojson';
15
15
  import { Polygon as Polygon_2 } from 'geojson';
16
16
  import { PropsWithoutRef } from 'react';
@@ -160,6 +160,7 @@ export declare type CameraProperty = {
160
160
 
161
161
  export declare type Cesium3DTilesAppearance = {
162
162
  show?: boolean;
163
+ height?: number;
163
164
  color?: string;
164
165
  styleUrl?: string;
165
166
  shadows?: "disabled" | "enabled" | "cast_only" | "receive_only";
@@ -279,7 +280,7 @@ declare type CommonProps = {
279
280
  sketchEditingFeature?: SketchEditingFeature;
280
281
  };
281
282
 
282
- export declare function computeAtom(cache?: typeof globalDataFeaturesCache): WritableAtom<ComputedLayer | undefined, Command, void>;
283
+ export declare function computeAtom(cache?: typeof globalDataFeaturesCache): WritableAtom<ComputedLayer | undefined, [Command], void>;
283
284
 
284
285
  export declare type ComputedFeature = CommonFeature<"computedFeature"> & Partial<AppearanceTypes>;
285
286
 
@@ -334,9 +335,9 @@ declare type CoreContext = {
334
335
 
335
336
  export declare const coreContext: Context<CoreContext>;
336
337
 
337
- export declare const CoreVisualizer: MemoExoticComponent<ForwardRefExoticComponent<CoreVisualizerProps & {
338
- children?: ReactNode;
339
- } & RefAttributes<MapRef>>>;
338
+ export declare const CoreVisualizer: NamedExoticComponent<CoreVisualizerProps & {
339
+ children?: ReactNode | undefined;
340
+ } & RefAttributes<MapRef>>;
340
341
 
341
342
  export declare type CoreVisualizerProps = {
342
343
  engine?: EngineType;
@@ -350,6 +351,7 @@ export declare type CoreVisualizerProps = {
350
351
  interactionMode?: InteractionModeType;
351
352
  shouldRender?: boolean;
352
353
  meta?: Record<string, unknown>;
354
+ customProvider?: CustomProviderConfig;
353
355
  style?: CSSProperties;
354
356
  small?: boolean;
355
357
  ready?: boolean;
@@ -367,16 +369,31 @@ export declare type CoreVisualizerProps = {
367
369
  onSketchFeatureDelete?: (layerId: string, featureId: string) => void;
368
370
  onInteractionModeChange?: (mode: InteractionModeType) => void;
369
371
  onAPIReady?: () => void;
370
- onCreditsUpdate?: (credits: Credit[]) => void;
372
+ onCreditsUpdate?: (credits?: Credits) => void;
371
373
  };
372
374
 
373
- export declare type Credit = {
375
+ export declare type CreditItem = {
374
376
  html?: string;
375
377
  };
376
378
 
377
- export declare type CursorType = "auto" | "grab" | "crosshair";
379
+ export declare type Credits = {
380
+ engine: {
381
+ cesium?: CreditItem;
382
+ };
383
+ lightbox: CreditItem[];
384
+ screen: CreditItem[];
385
+ };
378
386
 
379
- declare type CursorType_2 = "default" | "auto" | "help" | "pointer" | "grab" | "crosshair";
387
+ declare type CursorType = "default" | "auto" | "help" | "pointer" | "grab" | "crosshair" | "wait";
388
+
389
+ export declare type CustomProviderConfig = {
390
+ imagery?: {
391
+ providers?: ImageryProviderEntry[];
392
+ };
393
+ layers?: {
394
+ providers?: LayerProviderEntry[];
395
+ };
396
+ };
380
397
 
381
398
  export declare type Data = {
382
399
  type: DataType;
@@ -388,6 +405,7 @@ export declare type Data = {
388
405
  updateInterval?: number;
389
406
  parameters?: Record<string, any>;
390
407
  idProperty?: string;
408
+ provider?: string;
391
409
  serviceTokens?: {
392
410
  googleMapApiKey?: string;
393
411
  };
@@ -415,7 +433,7 @@ export declare type DataRange = {
415
433
  z: number;
416
434
  };
417
435
 
418
- export declare type DataType = "geojson" | "3dtiles" | "osm-buildings" | "google-photorealistic" | "czml" | "csv" | "wms" | "mvt" | "kml" | "gpx" | "shapefile" | "gtfs" | "gml" | "georss" | "gltf" | "tiles" | "tms" | "heatMap";
436
+ export declare type DataType = "geojson" | "3dtiles" | "osm-buildings" | "reearth-buildings" | "google-photorealistic" | "czml" | "csv" | "wms" | "mvt" | "kml" | "gpx" | "shapefile" | "gtfs" | "gml" | "georss" | "gltf" | "tiles" | "tms" | "heatMap";
419
437
 
420
438
  export declare type DebugProperty = {
421
439
  showGlobeWireframe?: boolean;
@@ -504,8 +522,9 @@ export declare type EngineProps = {
504
522
  isLayerDragging?: boolean;
505
523
  shouldRender?: boolean;
506
524
  meta?: Record<string, unknown>;
525
+ customProvider?: CustomProviderConfig;
507
526
  displayCredits?: boolean;
508
- layersRef?: RefObject<LayersRef>;
527
+ layersRef?: RefObject<LayersRef | null>;
509
528
  requestingRenderMode?: MutableRefObject<RequestingRenderMode>;
510
529
  timelineManagerRef?: TimelineManagerRef;
511
530
  onLayerSelect?: (layerId: string | undefined, featureId?: string, options?: LayerSelectionReason, info?: SelectedFeatureInfo) => void;
@@ -519,7 +538,7 @@ export declare type EngineProps = {
519
538
  onLayerSelectWithRectStart?: (e: LayerSelectWithRectStart) => void;
520
539
  onLayerSelectWithRectMove?: (e: LayerSelectWithRectMove) => void;
521
540
  onLayerSelectWithRectEnd?: (e: LayerSelectWithRectEnd) => void;
522
- onCreditsUpdate?: (credits: Credit[]) => void;
541
+ onCreditsUpdate?: (credits?: Credits) => void;
523
542
  };
524
543
 
525
544
  export declare type EngineRef = {
@@ -557,7 +576,7 @@ export declare type EngineRef = {
557
576
  type: SketchType;
558
577
  controlPoints: Position3d[];
559
578
  }) => LineString | Polygon_2 | MultiPolygon | Point | undefined;
560
- setCursor: (cursor: CursorType_2) => void;
579
+ setCursor: (cursor: CursorType) => void;
561
580
  flyTo: FlyTo;
562
581
  flyToBBox: (bbox: [number, number, number, number], options?: CameraOptions & {
563
582
  heading?: number;
@@ -596,7 +615,7 @@ export declare type EngineRef = {
596
615
  tick: () => Date | void;
597
616
  inViewport: (location?: LatLng) => boolean;
598
617
  onTick: TickEvent;
599
- tickEventCallback?: RefObject<TickEventCallback[]>;
618
+ tickEventCallback?: RefObject<TickEventCallback[] | null>;
600
619
  removeTickEventListener: TickEvent;
601
620
  findFeatureById: (layerId: string, featureId: string) => Feature | undefined;
602
621
  bringToFront: (layerId: string) => void;
@@ -608,7 +627,7 @@ export declare type EngineRef = {
608
627
  unselectFeatures: (layerId: string, featureId: string[]) => void;
609
628
  pickManyFromViewport: (windowPosition: [x: number, y: number], windowWidth: number, windowHeight: number, condition?: (f: PickedFeature) => boolean) => PickedFeature[] | undefined;
610
629
  calcRectangleControlPoint: (p1: Position3d, p2: Position3d, p3: Position3d) => [p1: Position3d, p2: Position3d, p3: Position3d];
611
- getCredits: () => Credit[] | undefined;
630
+ getCredits: () => Credits | undefined;
612
631
  } & MouseEventHandles;
613
632
 
614
633
  export declare const engines: {
@@ -765,6 +784,17 @@ export declare type FrustumAppearance = {
765
784
  length?: number;
766
785
  };
767
786
 
787
+ export declare type GeoidProperty = {
788
+ server: {
789
+ url: string;
790
+ geoidProperty: string;
791
+ };
792
+ };
793
+
794
+ declare type GeoidRef = {
795
+ getGeoidHeight: (lat?: number, lng?: number) => Promise<number | undefined>;
796
+ };
797
+
768
798
  export declare type Geometry = Point | LineString | Polygon_2 | MultiPoint | MultiLineString | MultiPolygon;
769
799
 
770
800
  export declare type GeometryOptionsXYZ = {
@@ -776,11 +806,11 @@ export declare function getCompat(l: Layer | undefined): LayerCompat | undefined
776
806
 
777
807
  declare const globalDataFeaturesCache: {
778
808
  get: Atom_2<(key: string, key2: string) => Feature[] | undefined>;
779
- set: WritableAtom<null, {
809
+ set: WritableAtom<null, [value: {
780
810
  key: string;
781
811
  key2: string;
782
812
  value?: Feature[] | undefined;
783
- }, void> & {
813
+ }], void> & {
784
814
  init: null;
785
815
  };
786
816
  getAll: Atom_2<(key: string) => Feature[][] | undefined>;
@@ -826,6 +856,23 @@ export declare type ImageBasedLighting = {
826
856
  sphericalHarmonicCoefficients?: [number, number, number][];
827
857
  };
828
858
 
859
+ /**
860
+ * Generic provider configuration for overriding external data sources.
861
+ *
862
+ * - imagery.providers: imagery tile providers keyed by id
863
+ * - layers.providers: 3D tileset providers keyed by id
864
+ *
865
+ * Terrain is configured via viewer/engine terrain settings (see useTerrainProviderPromise)
866
+ * or via each layer's own `url` field.
867
+ */
868
+ export declare type ImageryProviderEntry = {
869
+ id: string;
870
+ url: string;
871
+ credit?: string;
872
+ maximumLevel?: number;
873
+ minimumLevel?: number;
874
+ };
875
+
829
876
  export declare type IndicatorProperty = {
830
877
  type?: "default" | "crosshair" | "custom";
831
878
  image?: string;
@@ -926,6 +973,12 @@ export declare type LayerLoadEvent = {
926
973
  layerId: string | undefined;
927
974
  };
928
975
 
976
+ export declare type LayerProviderEntry = {
977
+ id: string;
978
+ url: string;
979
+ options?: Record<string, unknown>;
980
+ };
981
+
929
982
  export declare type LayerSelectionReason = {
930
983
  reason?: string;
931
984
  defaultInfobox?: DefaultInfobox;
@@ -1090,12 +1143,10 @@ export declare type LookAtDestination = {
1090
1143
  export declare type LUT = readonly ColorTuple[];
1091
1144
 
1092
1145
  declare const Map_2: ForwardRefExoticComponent< {
1093
- engines?: Record<string, Engine> | undefined;
1094
- engine?: string | undefined;
1095
- onAPIReady?: (() => void) | undefined;
1096
- } & Omit<Props_2, "Feature" | "viewerProperty" | "selectionReason" | "delegatedDataTypes" | "clusterComponent" | "selectedLayerId"> & Omit<EngineProps, "onLayerSelect" | "selectedLayerId" | "layerSelectionReason"> & Omit<SketchProps, "engineRef" | "SketchComponent" | "layersRef"> & {
1097
- cursor?: CursorType | undefined;
1098
- } & RefAttributes<MapRef>>;
1146
+ engines?: Record<string, Engine>;
1147
+ engine?: string;
1148
+ onAPIReady?: () => void;
1149
+ } & Omit<Props_2, "Feature" | "viewerProperty" | "selectionReason" | "delegatedDataTypes" | "clusterComponent" | "selectedLayerId"> & Omit<EngineProps, "onLayerSelect" | "selectedLayerId" | "layerSelectionReason"> & Omit<SketchProps, "engineRef" | "SketchComponent" | "layersRef"> & RefAttributes<MapRef>>;
1099
1150
  export { Map_2 as Map }
1100
1151
 
1101
1152
  export declare type MapRef = {
@@ -1103,6 +1154,7 @@ export declare type MapRef = {
1103
1154
  layers: WrappedRef<LayersRef>;
1104
1155
  sketch: WrappedRef<SketchRef>;
1105
1156
  spatialId?: WrappedRef<SpatialIdRef>;
1157
+ geoid: WrappedRef<GeoidRef>;
1106
1158
  timeline?: TimelineManagerRef;
1107
1159
  };
1108
1160
 
@@ -1155,6 +1207,7 @@ export declare type ModelAppearance = {
1155
1207
  model?: string;
1156
1208
  url?: string;
1157
1209
  heightReference?: "none" | "clamp" | "relative";
1210
+ height?: number;
1158
1211
  heading?: number;
1159
1212
  pitch?: number;
1160
1213
  roll?: number;
@@ -1338,9 +1391,7 @@ export declare type Props = {
1338
1391
  engines?: Record<string, Engine>;
1339
1392
  engine?: string;
1340
1393
  onAPIReady?: () => void;
1341
- } & Omit<Props_2, "Feature" | "clusterComponent" | "selectionReason" | "delegatedDataTypes" | "selectedLayerId" | "viewerProperty"> & Omit<EngineProps, "onLayerSelect" | "layerSelectionReason" | "selectedLayerId"> & Omit<SketchProps, "layersRef" | "engineRef" | "SketchComponent"> & {
1342
- cursor?: CursorType;
1343
- };
1394
+ } & Omit<Props_2, "Feature" | "clusterComponent" | "selectionReason" | "delegatedDataTypes" | "selectedLayerId" | "viewerProperty"> & Omit<EngineProps, "onLayerSelect" | "layerSelectionReason" | "selectedLayerId"> & Omit<SketchProps, "layersRef" | "engineRef" | "SketchComponent">;
1344
1395
 
1345
1396
  declare type Props_2 = Omit<Props_3, "atomMap" | "isHidden" | "selectedLayerId"> & {
1346
1397
  selectedLayer?: {
@@ -1351,7 +1402,7 @@ declare type Props_2 = Omit<Props_3, "atomMap" | "isHidden" | "selectedLayerId">
1351
1402
  hiddenLayers?: string[];
1352
1403
  viewerProperty?: ViewerProperty;
1353
1404
  requestingRenderMode?: MutableRefObject<RequestingRenderMode>;
1354
- engineRef?: RefObject<EngineRef>;
1405
+ engineRef?: RefObject<EngineRef | null>;
1355
1406
  onLayerSelect?: (layerId: string | undefined, featureId: string | undefined, layer: (() => Promise<ComputedLayer | undefined>) | undefined, reason: LayerSelectionReason | undefined, info: SelectedFeatureInfo | undefined) => void;
1356
1407
  onMount?: () => void;
1357
1408
  };
@@ -1535,8 +1586,8 @@ export declare type SketchOptions = {
1535
1586
  };
1536
1587
 
1537
1588
  export declare type SketchProps = {
1538
- layersRef: RefObject<LayersRef>;
1539
- engineRef: RefObject<EngineRef>;
1589
+ layersRef: RefObject<LayersRef | null>;
1590
+ engineRef: RefObject<EngineRef | null>;
1540
1591
  SketchComponent?: SketchComponentType;
1541
1592
  selectedFeature?: Feature;
1542
1593
  interactionMode?: InteractionModeType;
@@ -1600,9 +1651,16 @@ export declare type Spacing = {
1600
1651
  declare type SpatialIdPickSpaceOptions = {
1601
1652
  zoom?: number;
1602
1653
  maxHeight?: number;
1603
- color?: string;
1654
+ minHeight?: number;
1604
1655
  dataOnly?: boolean;
1605
1656
  rightClickToExit?: boolean;
1657
+ color?: string;
1658
+ outlineColor?: string;
1659
+ groundIndicatorColor?: string;
1660
+ selectorColor?: string;
1661
+ selectorOutlineColor?: string;
1662
+ verticalSpaceIndicatorColor?: string;
1663
+ verticalSpaceIndicatorOutlineColor?: string;
1606
1664
  };
1607
1665
 
1608
1666
  declare type SpatialIdRef = {
@@ -1647,7 +1705,7 @@ export declare type Tag = {
1647
1705
 
1648
1706
  export declare type TerrainProperty = {
1649
1707
  enabled?: boolean;
1650
- type?: "cesium" | "arcgis" | "cesiumion";
1708
+ type?: "cesium" | "cesiumion" | "reearth_terrain";
1651
1709
  url?: string;
1652
1710
  normal?: boolean;
1653
1711
  elevationHeatMap?: ElevationHeatMapProperty;
@@ -1679,6 +1737,7 @@ export declare type TileProperty = {
1679
1737
  id: string;
1680
1738
  type?: string;
1681
1739
  url?: string;
1740
+ cesiumIonAssetId?: number;
1682
1741
  opacity?: number;
1683
1742
  zoomLevel?: number[];
1684
1743
  zoomLevelForURL?: number[];
@@ -1704,7 +1763,7 @@ declare type TimelineCommit = (PlayCommand | PauseCommand | SetTimeCommand | Set
1704
1763
  };
1705
1764
 
1706
1765
  export declare type TimelineCommitter = {
1707
- source: "widgetContext" | "pluginAPI" | "featureResource" | "storyTimelineBlock" | "storyPage" | "initialize";
1766
+ source: string;
1708
1767
  id?: string;
1709
1768
  };
1710
1769
 
@@ -1768,7 +1827,7 @@ export declare type Undefinable<T extends object> = {
1768
1827
 
1769
1828
  export declare function useGet<T>(value: T): () => T;
1770
1829
 
1771
- export declare const useVisualizer: () => RefObject<MapRef>;
1830
+ export declare const useVisualizer: () => RefObject<MapRef | null>;
1772
1831
 
1773
1832
  export declare type ValueType = keyof ValueTypes;
1774
1833
 
@@ -1793,6 +1852,7 @@ export declare type ValueTypes = {
1793
1852
 
1794
1853
  export declare type ViewerProperty = {
1795
1854
  globe?: GlobeProperty;
1855
+ geoid?: GeoidProperty;
1796
1856
  terrain?: TerrainProperty;
1797
1857
  scene?: SceneProperty;
1798
1858
  tiles?: TileProperty[];
@@ -1812,7 +1872,7 @@ export declare type Viewport = {
1812
1872
  query: Record<string, string>;
1813
1873
  };
1814
1874
 
1815
- export declare type VisualizerContext = RefObject<MapRef>;
1875
+ export declare type VisualizerContext = RefObject<MapRef | null>;
1816
1876
 
1817
1877
  export declare type WrappedRef<T> = {
1818
1878
  [P in keyof T as T[P] extends (...args: any[]) => any ? P : never]: T[P] extends (...args: infer A) => infer R ? (...args: A) => R | undefined : never;
@@ -1821,38 +1881,8 @@ export declare type WrappedRef<T> = {
1821
1881
  export { }
1822
1882
 
1823
1883
 
1824
- declare global {
1825
- interface Window {
1826
- REEARTH_E2E_ACCESS_TOKEN?: string;
1827
- REEARTH_E2E_CESIUM_VIEWER?: any;
1828
- }
1829
- }
1830
-
1831
-
1832
1884
  declare module "@cesium/engine" {
1833
1885
  namespace SceneTransforms {
1834
1886
  function transformWindowToDrawingBuffer(scene: Scene, windowPosition: Cartesian2, result?: Cartesian2): Cartesian2;
1835
1887
  }
1836
1888
  }
1837
-
1838
-
1839
- namespace SceneTransforms {
1840
- function transformWindowToDrawingBuffer(scene: Scene, windowPosition: Cartesian2, result?: Cartesian2): Cartesian2;
1841
- }
1842
-
1843
-
1844
- declare global {
1845
- namespace Vi {
1846
- interface JestAssertion<T = any> extends jest.Matchers<void, T>, EmotionMatchers {
1847
- toHaveStyleRule: EmotionMatchers["toHaveStyleRule"];
1848
- }
1849
- }
1850
- }
1851
-
1852
-
1853
- namespace Vi {
1854
- interface JestAssertion<T = any> extends jest.Matchers<void, T>, EmotionMatchers {
1855
- toHaveStyleRule: EmotionMatchers["toHaveStyleRule"];
1856
- }
1857
- }
1858
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reearth/core",
3
- "version": "0.0.7-alpha.63",
3
+ "version": "0.0.7-alpha.64",
4
4
  "author": "Re:Earth contributors <community@reearth.io>",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A library that abstracts a map engine as one common API.",