feat(map): publish shared Cesium adapter
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
export const MAP_RUNTIME_SCHEMA_VERSION = "missioncore.map-runtime/v1" as const;
|
||||
export const MAP_PAGE_VERSION = "0.1.0" as const;
|
||||
export const CESIUM_RENDERER_VERSION = "1.143.0" as const;
|
||||
|
||||
export type MapProviderId = "imagery" | "terrain" | "buildings";
|
||||
export type MapProviderPhase = "idle" | "loading" | "ready" | "disabled" | "error";
|
||||
export type MapRenderPhase =
|
||||
| "loading"
|
||||
| "ready"
|
||||
| "degraded"
|
||||
| "gateway-unavailable"
|
||||
| "render-error";
|
||||
|
||||
export type MapRuntimeConfiguration = {
|
||||
schema_version: typeof MAP_RUNTIME_SCHEMA_VERSION;
|
||||
map_page_version: typeof MAP_PAGE_VERSION;
|
||||
renderer: {
|
||||
id: "cesium";
|
||||
version: typeof CESIUM_RENDERER_VERSION;
|
||||
};
|
||||
gateway: {
|
||||
configured: true;
|
||||
health_url: string;
|
||||
asset_endpoint_template: string;
|
||||
cache_proxy_prefix: string;
|
||||
};
|
||||
assets: Record<MapProviderId, number>;
|
||||
};
|
||||
|
||||
export type MapGatewayError = {
|
||||
schema_version?: string;
|
||||
code?: string;
|
||||
retryable?: boolean;
|
||||
};
|
||||
|
||||
export type MapProviderState = {
|
||||
phase: MapProviderPhase;
|
||||
code?: string;
|
||||
attributions?: readonly unknown[];
|
||||
};
|
||||
|
||||
export type MapRuntimeState = {
|
||||
phase: MapRenderPhase;
|
||||
providers: Record<MapProviderId, MapProviderState>;
|
||||
code?: string;
|
||||
};
|
||||
|
||||
export type MapCamera = {
|
||||
longitude: number;
|
||||
latitude: number;
|
||||
height: number;
|
||||
heading: number;
|
||||
pitch: number;
|
||||
roll: number;
|
||||
};
|
||||
|
||||
export type MapLayerVisibility = {
|
||||
imagery: boolean;
|
||||
terrain: boolean;
|
||||
buildings: boolean;
|
||||
grid: boolean;
|
||||
targets: boolean;
|
||||
};
|
||||
|
||||
export type MapVisualSettings = {
|
||||
atmosphere_enabled: boolean;
|
||||
lighting_enabled: boolean;
|
||||
monochrome_enabled: boolean;
|
||||
terrain_exaggeration: number;
|
||||
buildings_maximum_screen_space_error: number;
|
||||
camera_animation_enabled: boolean;
|
||||
};
|
||||
|
||||
export type MapCacheIntent = {
|
||||
enabled: boolean;
|
||||
no_overwrite: boolean;
|
||||
};
|
||||
|
||||
export type CesiumMapRendererProps = {
|
||||
runtimeConfigUrl: string;
|
||||
camera: MapCamera | null;
|
||||
layers: MapLayerVisibility;
|
||||
settings: MapVisualSettings;
|
||||
cacheIntent: MapCacheIntent;
|
||||
rendererGeneration?: number;
|
||||
className?: string;
|
||||
onRuntimeStateChange?: (state: MapRuntimeState) => void;
|
||||
onCameraChange?: (camera: MapCamera) => void;
|
||||
};
|
||||
Reference in New Issue
Block a user