@jorgmoritz/gis-manager 0.1.31 → 0.1.33

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
@@ -780,156 +780,6 @@ declare function renderFlightPathPreview(CesiumNS: typeof Cesium, viewer: Cesium
780
780
  controller: FlightPathPreviewController;
781
781
  };
782
782
 
783
- /**
784
- * 飞行预览控制器
785
- *
786
- * 功能:
787
- * - 飞机沿航线飞行动画(循环播放)
788
- * - 第一人称镜头预览窗口
789
- * - 轨迹高亮(已飞过/未飞过航段)
790
- * - 预览模式下禁用交互
791
- */
792
-
793
- /** 播放状态 */
794
- type FlightPreviewState = 'playing' | 'paused' | 'stopped';
795
- /** 轨迹高亮配置 */
796
- interface TrackHighlightOptions {
797
- /** 是否启用,默认 true */
798
- enabled?: boolean;
799
- /** 已飞过航段颜色 */
800
- traveledColor?: Cesium.Color;
801
- /** 未飞过航段颜色 */
802
- remainingColor?: Cesium.Color;
803
- /** 已飞过航段宽度 */
804
- traveledWidth?: number;
805
- /** 未飞过航段宽度 */
806
- remainingWidth?: number;
807
- }
808
- /** 飞行预览选项 */
809
- interface FlightPreviewOptions {
810
- /** 航线数据 */
811
- waylineData: SinoflyWaylineData;
812
- /** 飞行速度 (m/s),默认 10 */
813
- speed?: number;
814
- /** 是否循环播放,默认 true */
815
- loop?: boolean;
816
- /** 预览窗口容器 */
817
- previewContainer?: HTMLElement;
818
- /** 是否显示视锥体,默认 true */
819
- showFrustum?: boolean;
820
- /** 轨迹高亮配置 */
821
- trackHighlight?: TrackHighlightOptions;
822
- /** 数据源图层 */
823
- layer?: Cesium.CustomDataSource;
824
- }
825
- /** 进度变化事件 */
826
- interface ProgressChangeEvent {
827
- /** 当前进度 (0-1) */
828
- progress: number;
829
- /** 当前位置 */
830
- position: Cesium.Cartesian3;
831
- /** 当前航点索引 */
832
- waypointIndex: number;
833
- /** 当前姿态 */
834
- pose: {
835
- heading: number;
836
- pitch: number;
837
- roll: number;
838
- };
839
- }
840
- /** 状态变化事件 */
841
- interface StateChangeEvent {
842
- state: FlightPreviewState;
843
- }
844
- /**
845
- * 飞行预览控制器
846
- */
847
- declare class FlightPreviewController {
848
- private CesiumNS;
849
- private viewer;
850
- private options;
851
- private state;
852
- private destroyed;
853
- private speed;
854
- private loop;
855
- private showFrustum;
856
- private trackHighlightOptions;
857
- private waypoints;
858
- private totalDistance;
859
- private currentDistance;
860
- private animationFrameId?;
861
- private lastFrameTime?;
862
- private layer?;
863
- private droneEntity?;
864
- private frustum?;
865
- private pathPreview?;
866
- private traveledPathEntity?;
867
- private remainingPathEntity?;
868
- onStateChange: Emitter<StateChangeEvent>;
869
- onProgressChange: Emitter<ProgressChangeEvent>;
870
- constructor(CesiumNS: typeof Cesium, viewer: Cesium.Viewer, options: FlightPreviewOptions);
871
- /** 开始预览 */
872
- start(): void;
873
- /** 暂停 */
874
- pause(): void;
875
- /** 继续 */
876
- resume(): void;
877
- /** 停止并重置 */
878
- stop(): void;
879
- /** 跳转到指定进度 (0-1) */
880
- seek(progress: number): void;
881
- /** 设置速度 */
882
- setSpeed(speed: number): void;
883
- /** 获取当前状态 */
884
- getState(): FlightPreviewState;
885
- /** 获取当前进度 (0-1) */
886
- getProgress(): number;
887
- /** 获取当前航点索引 */
888
- getCurrentWaypointIndex(): number;
889
- /** 销毁 */
890
- destroy(): void;
891
- /** 初始化图层 */
892
- private initLayer;
893
- /** 解析航线数据 */
894
- private parseWaylineData;
895
- /** 初始化可视化组件 */
896
- private initVisualization;
897
- /** 初始化无人机模型 */
898
- private initDroneModel;
899
- /** 应用模型偏移 */
900
- private applyModelOffset;
901
- /** 初始化视锥体 */
902
- private initFrustum;
903
- /** 初始化轨迹高亮 */
904
- private initTrackHighlight;
905
- /** 初始化预览窗口 */
906
- private initPathPreview;
907
- /** 启动动画循环 */
908
- private startAnimationLoop;
909
- /** 停止动画循环 */
910
- private stopAnimationLoop;
911
- /** 查找当前所在航段 */
912
- private findCurrentSegment;
913
- /** 获取当前姿态 */
914
- private getCurrentPose;
915
- /** 位置插值 */
916
- private interpolatePosition;
917
- /** 角度插值(处理 0-360 环绕) */
918
- private interpolateAngle;
919
- /** 线性插值 */
920
- private lerp;
921
- /** 获取已飞过的位置数组 */
922
- private getTraveledPositions;
923
- /** 获取未飞过的位置数组 */
924
- private getRemainingPositions;
925
- /** 更新可视化 */
926
- private updateVisualization;
927
- /** 设置状态 */
928
- private setState;
929
- /** 销毁可视化组件 */
930
- private destroyVisualization;
931
- }
932
-
933
783
  type PathSample = {
934
784
  time: Cesium.JulianDate | Date | string | number;
935
785
  lon: number;
@@ -1298,6 +1148,7 @@ declare class PolygonEditor {
1298
1148
  private insertPreviewHandle?;
1299
1149
  private keydownHandler?;
1300
1150
  private originalPolygonNames;
1151
+ private doubleClickZoomDisabled;
1301
1152
  constructor(CesiumNS: typeof Cesium, viewer: Viewer$1);
1302
1153
  /**
1303
1154
  * 根据图层名称获取颜色配置
@@ -1355,6 +1206,16 @@ declare class PolygonEditor {
1355
1206
  * 销毁事件处理器
1356
1207
  */
1357
1208
  private destroyHandler;
1209
+ /**
1210
+ * 禁用 Cesium 默认的双击缩放行为
1211
+ * 在绘制/编辑过程中调用,防止双击导致相机乱飞
1212
+ */
1213
+ private disableDoubleClickZoom;
1214
+ /**
1215
+ * 恢复 Cesium 默认的双击缩放行为
1216
+ * 在绘制/编辑结束后调用
1217
+ */
1218
+ private restoreDoubleClickZoom;
1358
1219
  /**
1359
1220
  * 完成编辑/绘制的通用清理逻辑
1360
1221
  */
@@ -1788,26 +1649,20 @@ interface PreviousViewChange {
1788
1649
  current?: CameraView;
1789
1650
  previous?: CameraView;
1790
1651
  }
1791
- interface FlightPreviewChange {
1792
- previewing: boolean;
1793
- }
1794
1652
  /**
1795
1653
  * Lightweight state manager for common UI states:
1796
1654
  * - selection (arbitrary payload)
1797
1655
  * - editing (boolean + optional target)
1798
1656
  * - previous camera view (for simple back navigation)
1799
- * - flight preview mode (locks interaction)
1800
1657
  */
1801
1658
  declare class StateManager<TSelection = unknown, TEditingTarget = unknown> {
1802
1659
  private selected?;
1803
1660
  private editing;
1804
1661
  private editingTarget?;
1805
1662
  private previousView?;
1806
- private flightPreviewing;
1807
1663
  readonly onSelectionChange: Emitter<SelectionChange<TSelection>>;
1808
1664
  readonly onEditingChange: Emitter<EditingChange<TEditingTarget>>;
1809
1665
  readonly onPreviousViewChange: Emitter<PreviousViewChange>;
1810
- readonly onFlightPreviewChange: Emitter<FlightPreviewChange>;
1811
1666
  setSelected(next?: TSelection): void;
1812
1667
  /**
1813
1668
  * 获取当前选中对象。
@@ -1824,22 +1679,6 @@ declare class StateManager<TSelection = unknown, TEditingTarget = unknown> {
1824
1679
  getEditingTarget(): TEditingTarget | undefined;
1825
1680
  setPreviousCameraView(view?: CameraView): void;
1826
1681
  getPreviousCameraView(): CameraView | undefined;
1827
- /**
1828
- * 开始飞行预览模式(锁定交互)
1829
- */
1830
- startFlightPreview(): void;
1831
- /**
1832
- * 停止飞行预览模式(恢复交互)
1833
- */
1834
- stopFlightPreview(): void;
1835
- /**
1836
- * 检查是否处于飞行预览模式
1837
- */
1838
- isFlightPreviewing(): boolean;
1839
- /**
1840
- * 检查当前是否允许交互(非编辑模式且非飞行预览模式)
1841
- */
1842
- isInteractionAllowed(): boolean;
1843
1682
  }
1844
1683
  declare const globalState: StateManager<any, any>;
1845
1684
 
@@ -2218,8 +2057,116 @@ interface PathToSinoflyOptions {
2218
2057
  */
2219
2058
  declare function convertPathToSinofly(data: PathEditingSaveResult, options: PathToSinoflyOptions): SinoflyWaylineData;
2220
2059
 
2060
+ /**
2061
+ * 单个航段安全检测结果
2062
+ */
2063
+ interface SegmentSafetyResult {
2064
+ /** 起点索引 */
2065
+ fromIndex: number;
2066
+ /** 终点索引 */
2067
+ toIndex: number;
2068
+ /** 地形距离是否安全 */
2069
+ isTerrainSafe: boolean;
2070
+ /** 点云距离是否安全 */
2071
+ isPointCloudSafe: boolean;
2072
+ /** 航点间距是否安全 */
2073
+ isDistanceSafe: boolean;
2074
+ /** 是否安全(综合判断) */
2075
+ isSafe: boolean;
2076
+ /** 与地形最小距离(米) */
2077
+ minTerrainDistance: number;
2078
+ /** 与点云最小距离(米) */
2079
+ minPointCloudDistance: number;
2080
+ /** 航段长度(米) */
2081
+ segmentLength: number;
2082
+ /** 危险点列表 */
2083
+ dangerPoints: Cesium.Cartesian3[];
2084
+ }
2085
+ /**
2086
+ * 完整路径安全检测结果
2087
+ */
2088
+ interface PathSafetyCheckResult {
2089
+ /** 是否全部安全 */
2090
+ allSafe: boolean;
2091
+ /** 所有航段结果 */
2092
+ segments: SegmentSafetyResult[];
2093
+ /** 不安全的航段 */
2094
+ unsafeSegments: SegmentSafetyResult[];
2095
+ /** 地形安全距离阈值 */
2096
+ terrainSafetyDistance: number;
2097
+ /** 点云安全距离阈值 */
2098
+ pointCloudSafetyDistance: number;
2099
+ /** 航点间最小距离阈值 */
2100
+ minWaypointDistance: number;
2101
+ }
2102
+ /**
2103
+ * 安全检测选项
2104
+ */
2105
+ interface PathSafetyCheckOptions {
2106
+ /**
2107
+ * 统一安全距离(米),同时设置地形和点云安全距离,默认 20
2108
+ * 如果单独设置了 terrainSafetyDistance 或 pointCloudSafetyDistance,会覆盖此值
2109
+ */
2110
+ safetyDistance?: number;
2111
+ /** 地形安全距离(米),航线与地形的最小距离,默认使用 safetyDistance */
2112
+ terrainSafetyDistance?: number;
2113
+ /** 点云安全距离(米),航线与点云的最小距离,默认使用 safetyDistance */
2114
+ pointCloudSafetyDistance?: number;
2115
+ /** 航点间最小距离(米),相邻航点之间的最小距离,默认 0(不检测) */
2116
+ minWaypointDistance?: number;
2117
+ /** 采样间隔(米),每隔多少米采样一次,默认 5 */
2118
+ sampleInterval?: number;
2119
+ }
2120
+ /**
2121
+ * 航线安全检测器
2122
+ * 检测航线与点云/地形之间的安全距离
2123
+ */
2124
+ declare class PathSafetyChecker {
2125
+ private CesiumNS;
2126
+ private viewer;
2127
+ constructor(CesiumNS: typeof Cesium, viewer: Cesium.Viewer);
2128
+ /**
2129
+ * 检测整条路径的安全性
2130
+ * @param positions 航点位置数组
2131
+ * @param options 检测选项
2132
+ */
2133
+ checkPath(positions: Cesium.Cartesian3[], options?: PathSafetyCheckOptions): PathSafetyCheckResult;
2134
+ /**
2135
+ * 检测单个航段的安全性
2136
+ * 支持多方向检测(上下左右前后6方向)和按间隔采样
2137
+ */
2138
+ private checkSegment;
2139
+ /**
2140
+ * 可视化危险点(用于调试)
2141
+ */
2142
+ visualizeDangerPoints(result: PathSafetyCheckResult, layer: Cesium.CustomDataSource): Cesium.Entity[];
2143
+ /**
2144
+ * 清除危险点可视化
2145
+ */
2146
+ clearDangerPoints(layer: Cesium.CustomDataSource): void;
2147
+ /**
2148
+ * 沿航线创建3D安全管道可视化(使用 Cylinder)
2149
+ * 每个航段创建一个水平圆柱体,圆柱轴心与航线重合
2150
+ * @param positions 航点位置数组
2151
+ * @param layer 实体图层
2152
+ * @param options 可视化选项
2153
+ */
2154
+ visualizeSafetyTube(positions: Cesium.Cartesian3[], layer: Cesium.CustomDataSource, options?: {
2155
+ /** 管道半径(米),即安全距离,默认 20 */
2156
+ radius?: number;
2157
+ /** 颜色,默认黄色半透明 */
2158
+ color?: Cesium.Color;
2159
+ /** 跳过第一段,默认 true */
2160
+ skipFirstSegment?: boolean;
2161
+ }): Cesium.Entity[];
2162
+ /**
2163
+ * 清除安全管道可视化
2164
+ */
2165
+ clearSafetyTube(layer: Cesium.CustomDataSource): void;
2166
+ }
2167
+
2221
2168
  declare const placeholder: {
2222
2169
  ready: boolean;
2223
2170
  };
2224
2171
 
2225
- export { CZMLManager, type CameraDestinationInput, CameraEventBus, type CameraFOVChangeEvent, CameraFOVController, type CameraFlyOptions, type CameraInitOptions, CameraManager, type CameraOrientation, type CameraPoseChangeEvent, type CameraSetViewOptions, type CameraView, type CesiumAssetsOptions, type ConvertedWaylineData, type ConvertedWaypointData, type CursorPoseChangeEvent, type CzmlExportOptions, type CzmlImportOptions, type EditingChange, Emitter, type FOVChangeEvent, type FOVControllerOptions, type FlightPathPreviewController, type FlightPreviewChange, FlightPreviewController, type FlightPreviewOptions, type FlightPreviewState, type FlyToOptions, FrustumPyramid, type FrustumPyramidOptions, type FrustumShapeChangeEvent, type ImageryOptions, type ImageryProviderKind, type InitOptions, type LayerEvents, type LayerHandle, LayerManager, type LayerType, type Listener, type LonLatHeight, type Orientation, type PathEditingSaveResult, type PathOptions, type PathToSinoflyOptions, type PhotoBillboardItem, type PhotoBillboardLayerOptions, type PhotoBillboardResult, type PolygonDrawingOptions, type PolygonEditingSession, PolygonEditor, type PreviousViewChange, type ProgressChangeEvent, type QuickEditOptions, type RenderFlightPathOptions, type RenderFlightPathPreviewOptions, SceneManager, type SceneOptions, type SelectionChange, type SelectionResult, type SelectionSession, Selector, type ShapeLineProps, type ShapePointProps, type ShapePolygonProps, type SinoflyAdapterOptions, type SinoflyWaylineData, type SinoflyWaypointInfo, type StateChangeEvent, StateManager, type TerrainKind, type TerrainOptions, type Toggle2D3DContext, type Toggle2D3DOptions, type TrackHighlightOptions, type VersionInfo, assertCesiumAssetsConfigured, configureCesiumAssets, configureCesiumIonToken, convertPathToSinofly, convertSinoflyWayline, convertSinoflyWaylines, ensureCesiumIonToken, getCesiumBaseUrl, getCesiumIonToken, globalCameraEventBus, globalState, placeholder, renderFlightPath, renderFlightPathPreview, toggle2D3D, version, versionInfo };
2172
+ export { CZMLManager, type CameraDestinationInput, CameraEventBus, type CameraFOVChangeEvent, CameraFOVController, type CameraFlyOptions, type CameraInitOptions, CameraManager, type CameraOrientation, type CameraPoseChangeEvent, type CameraSetViewOptions, type CameraView, type CesiumAssetsOptions, type ConvertedWaylineData, type ConvertedWaypointData, type CursorPoseChangeEvent, type CzmlExportOptions, type CzmlImportOptions, type EditingChange, Emitter, type FOVChangeEvent, type FOVControllerOptions, type FlightPathPreviewController, type FlyToOptions, FrustumPyramid, type FrustumPyramidOptions, type FrustumShapeChangeEvent, type ImageryOptions, type ImageryProviderKind, type InitOptions, type LayerEvents, type LayerHandle, LayerManager, type LayerType, type Listener, type LonLatHeight, type Orientation, type PathEditingSaveResult, type PathOptions, type PathSafetyCheckOptions, type PathSafetyCheckResult, PathSafetyChecker, type PathToSinoflyOptions, type PhotoBillboardItem, type PhotoBillboardLayerOptions, type PhotoBillboardResult, type PolygonDrawingOptions, type PolygonEditingSession, PolygonEditor, type PreviousViewChange, type QuickEditOptions, type RenderFlightPathOptions, type RenderFlightPathPreviewOptions, SceneManager, type SceneOptions, type SegmentSafetyResult, type SelectionChange, type SelectionResult, type SelectionSession, Selector, type ShapeLineProps, type ShapePointProps, type ShapePolygonProps, type SinoflyAdapterOptions, type SinoflyWaylineData, type SinoflyWaypointInfo, StateManager, type TerrainKind, type TerrainOptions, type Toggle2D3DContext, type Toggle2D3DOptions, type VersionInfo, assertCesiumAssetsConfigured, configureCesiumAssets, configureCesiumIonToken, convertPathToSinofly, convertSinoflyWayline, convertSinoflyWaylines, ensureCesiumIonToken, getCesiumBaseUrl, getCesiumIonToken, globalCameraEventBus, globalState, placeholder, renderFlightPath, renderFlightPathPreview, toggle2D3D, version, versionInfo };