@jorgmoritz/gis-manager 0.1.28 → 0.1.29

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.cts CHANGED
@@ -635,6 +635,7 @@ declare function convertSinoflyWaylines(dataList: SinoflyWaylineData[], options:
635
635
  waylineId?: number | string;
636
636
  }>;
637
637
 
638
+ type Entity$1 = Cesium.Entity;
638
639
  /**
639
640
  * 回显飞航路线的选项类型
640
641
  */
@@ -656,6 +657,128 @@ interface RenderFlightPathOptions {
656
657
  altitudeMode?: string;
657
658
  climbHeight?: number;
658
659
  }
660
+ /**
661
+ * 回显飞航路线:显示完整飞航路线、航点编号和起始点箭头
662
+ *
663
+ * 接收 Sinofly 航线路数据,自动转换为本库格式并渲染显示。
664
+ *
665
+ * 航点逻辑说明:
666
+ * - index 0: 起始点(起飞点),显示起始箭头(仅当有 takeOffRefPoint 时)
667
+ * - index 1: 隐藏转折点(隐藏爬升点),不显示标签(仅当有 takeOffRefPoint 时)
668
+ * - index 2: 第一个航线点,标记为 "S"
669
+ * - index 3+: 后续航线点,标记为 2, 3, 4...
670
+ *
671
+ * 如果没有 takeOffRefPoint,则:
672
+ * - index 0: 第一个航线点,标记为 "S"
673
+ * - index 1+: 后续航线点,标记为 2, 3, 4...
674
+ *
675
+ * @param CesiumNS Cesium 命名空间
676
+ * @param viewer Cesium Viewer 实例
677
+ * @param options 回显选项,包含 Sinofly 数据和配置
678
+ * @returns 创建的 polyline 实体
679
+ *
680
+ * @example
681
+ * ```typescript
682
+ * // 基本用法
683
+ * const sinoflyData = {
684
+ * waylineId: "12345",
685
+ * waylineName: "测试航线",
686
+ * takeOffSecurityHeight: 50,
687
+ * takeOffRefPoint: '{"longitude": 116.4074, "latitude": 39.9042, "height": 100}',
688
+ * waypointInfo: [
689
+ * {
690
+ * index: 0,
691
+ * latitude: "39.9045",
692
+ * longitude: "116.4078",
693
+ * altitude: "150.0",
694
+ * action: '[{"rotateYaw": {"aircraftHeading": 45}, "gimbalRotate": {"gimbalPitchRotateAngle": -10}}]'
695
+ * },
696
+ * // ... 更多航点
697
+ * ]
698
+ * };
699
+ *
700
+ * const entity = renderFlightPath(Cesium, viewer, {
701
+ * data: sinoflyData,
702
+ * adapterOptions: {
703
+ * parseActionForPose: true,
704
+ * defaultHeading: 0,
705
+ * defaultPitch: -10
706
+ * },
707
+ * layer: myLayer,
708
+ * style: { width: 8, color: Cesium.Color.GREEN }
709
+ * });
710
+ *
711
+ * // 自定义样式
712
+ * const entity = renderFlightPath(Cesium, viewer, {
713
+ * data: sinoflyData,
714
+ * id: 'my-flight-path',
715
+ * name: '自定义航线名称',
716
+ * style: {
717
+ * width: 10,
718
+ * material: new Cesium.PolylineOutlineMaterialProperty({
719
+ * color: Cesium.Color.BLUE,
720
+ * outlineColor: Cesium.Color.WHITE,
721
+ * outlineWidth: 2
722
+ * })
723
+ * }
724
+ * });
725
+ * ```
726
+ */
727
+ declare function renderFlightPath(CesiumNS: typeof Cesium, viewer: Cesium.Viewer, options: RenderFlightPathOptions): Entity$1;
728
+ /**
729
+ * 预览模式渲染选项(扩展基础选项)
730
+ */
731
+ interface RenderFlightPathPreviewOptions extends RenderFlightPathOptions {
732
+ /** 航点点击回调 */
733
+ onWaypointClick?: (index: number, waypointData: any) => void;
734
+ /** 初始选中的航点索引 */
735
+ initialSelectedIndex?: number;
736
+ }
737
+ /**
738
+ * 预览模式控制器接口
739
+ */
740
+ interface FlightPathPreviewController {
741
+ /** 设置选中的航点(高亮显示)*/
742
+ setSelectedWaypoint: (index: number | null) => void;
743
+ /** 获取当前选中的航点索引 */
744
+ getSelectedWaypoint: () => number | null;
745
+ /** 销毁控制器(移除事件监听等)*/
746
+ destroy: () => void;
747
+ }
748
+ /**
749
+ * 预览模式渲染飞航路线:支持航点点击高亮
750
+ *
751
+ * 与 renderFlightPath 不同,此函数返回一个控制器对象,支持:
752
+ * - 航点点击事件回调
753
+ * - 程序化设置选中航点(高亮显示)
754
+ * - 列表与地图双向联动
755
+ *
756
+ * @param CesiumNS Cesium 命名空间
757
+ * @param viewer Cesium Viewer 实例
758
+ * @param options 预览选项
759
+ * @returns 包含实体和控制器的对象
760
+ *
761
+ * @example
762
+ * ```typescript
763
+ * const { entity, controller } = renderFlightPathPreview(Cesium, viewer, {
764
+ * data: sinoflyData,
765
+ * onWaypointClick: (index, waypoint) => {
766
+ * console.log('点击了航点', index, waypoint);
767
+ * },
768
+ * initialSelectedIndex: 0
769
+ * });
770
+ *
771
+ * // 程序化设置选中航点
772
+ * controller.setSelectedWaypoint(2);
773
+ *
774
+ * // 销毁
775
+ * controller.destroy();
776
+ * ```
777
+ */
778
+ declare function renderFlightPathPreview(CesiumNS: typeof Cesium, viewer: Cesium.Viewer, options: RenderFlightPathPreviewOptions): {
779
+ entity: Entity$1;
780
+ controller: FlightPathPreviewController;
781
+ };
659
782
 
660
783
  type PathSample = {
661
784
  time: Cesium.JulianDate | Date | string | number;
@@ -741,6 +864,21 @@ declare class CZMLManager {
741
864
  * ```
742
865
  */
743
866
  renderFlightPath(options: RenderFlightPathOptions): Entity;
867
+ /**
868
+ * 预览模式渲染飞航路线:支持航点点击高亮
869
+ *
870
+ * 与 renderFlightPath 不同,此方法返回一个控制器对象,支持:
871
+ * - 航点点击事件回调
872
+ * - 程序化设置选中航点(高亮显示)
873
+ * - 列表与地图双向联动
874
+ *
875
+ * @param options 预览选项
876
+ * @returns 包含实体和控制器的对象
877
+ */
878
+ renderFlightPathPreview(options: RenderFlightPathPreviewOptions): {
879
+ entity: Entity;
880
+ controller: FlightPathPreviewController;
881
+ };
744
882
  addPathSample(entityOrId: Entity | string, sample: PathSample): void;
745
883
  addPathSamples(entityOrId: Entity | string, samples: PathSample[]): void;
746
884
  setPathSamples(entityOrId: Entity | string, samples: PathSample[]): void;
@@ -1912,4 +2050,4 @@ declare const placeholder: {
1912
2050
  ready: boolean;
1913
2051
  };
1914
2052
 
1915
- 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 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 QuickEditOptions, SceneManager, type SceneOptions, 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, toggle2D3D, version, versionInfo };
2053
+ 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 PathToSinoflyOptions, type PhotoBillboardItem, type PhotoBillboardLayerOptions, type PhotoBillboardResult, type PolygonDrawingOptions, type PolygonEditingSession, PolygonEditor, type PreviousViewChange, 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, 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 };
package/dist/index.d.ts CHANGED
@@ -635,6 +635,7 @@ declare function convertSinoflyWaylines(dataList: SinoflyWaylineData[], options:
635
635
  waylineId?: number | string;
636
636
  }>;
637
637
 
638
+ type Entity$1 = Cesium.Entity;
638
639
  /**
639
640
  * 回显飞航路线的选项类型
640
641
  */
@@ -656,6 +657,128 @@ interface RenderFlightPathOptions {
656
657
  altitudeMode?: string;
657
658
  climbHeight?: number;
658
659
  }
660
+ /**
661
+ * 回显飞航路线:显示完整飞航路线、航点编号和起始点箭头
662
+ *
663
+ * 接收 Sinofly 航线路数据,自动转换为本库格式并渲染显示。
664
+ *
665
+ * 航点逻辑说明:
666
+ * - index 0: 起始点(起飞点),显示起始箭头(仅当有 takeOffRefPoint 时)
667
+ * - index 1: 隐藏转折点(隐藏爬升点),不显示标签(仅当有 takeOffRefPoint 时)
668
+ * - index 2: 第一个航线点,标记为 "S"
669
+ * - index 3+: 后续航线点,标记为 2, 3, 4...
670
+ *
671
+ * 如果没有 takeOffRefPoint,则:
672
+ * - index 0: 第一个航线点,标记为 "S"
673
+ * - index 1+: 后续航线点,标记为 2, 3, 4...
674
+ *
675
+ * @param CesiumNS Cesium 命名空间
676
+ * @param viewer Cesium Viewer 实例
677
+ * @param options 回显选项,包含 Sinofly 数据和配置
678
+ * @returns 创建的 polyline 实体
679
+ *
680
+ * @example
681
+ * ```typescript
682
+ * // 基本用法
683
+ * const sinoflyData = {
684
+ * waylineId: "12345",
685
+ * waylineName: "测试航线",
686
+ * takeOffSecurityHeight: 50,
687
+ * takeOffRefPoint: '{"longitude": 116.4074, "latitude": 39.9042, "height": 100}',
688
+ * waypointInfo: [
689
+ * {
690
+ * index: 0,
691
+ * latitude: "39.9045",
692
+ * longitude: "116.4078",
693
+ * altitude: "150.0",
694
+ * action: '[{"rotateYaw": {"aircraftHeading": 45}, "gimbalRotate": {"gimbalPitchRotateAngle": -10}}]'
695
+ * },
696
+ * // ... 更多航点
697
+ * ]
698
+ * };
699
+ *
700
+ * const entity = renderFlightPath(Cesium, viewer, {
701
+ * data: sinoflyData,
702
+ * adapterOptions: {
703
+ * parseActionForPose: true,
704
+ * defaultHeading: 0,
705
+ * defaultPitch: -10
706
+ * },
707
+ * layer: myLayer,
708
+ * style: { width: 8, color: Cesium.Color.GREEN }
709
+ * });
710
+ *
711
+ * // 自定义样式
712
+ * const entity = renderFlightPath(Cesium, viewer, {
713
+ * data: sinoflyData,
714
+ * id: 'my-flight-path',
715
+ * name: '自定义航线名称',
716
+ * style: {
717
+ * width: 10,
718
+ * material: new Cesium.PolylineOutlineMaterialProperty({
719
+ * color: Cesium.Color.BLUE,
720
+ * outlineColor: Cesium.Color.WHITE,
721
+ * outlineWidth: 2
722
+ * })
723
+ * }
724
+ * });
725
+ * ```
726
+ */
727
+ declare function renderFlightPath(CesiumNS: typeof Cesium, viewer: Cesium.Viewer, options: RenderFlightPathOptions): Entity$1;
728
+ /**
729
+ * 预览模式渲染选项(扩展基础选项)
730
+ */
731
+ interface RenderFlightPathPreviewOptions extends RenderFlightPathOptions {
732
+ /** 航点点击回调 */
733
+ onWaypointClick?: (index: number, waypointData: any) => void;
734
+ /** 初始选中的航点索引 */
735
+ initialSelectedIndex?: number;
736
+ }
737
+ /**
738
+ * 预览模式控制器接口
739
+ */
740
+ interface FlightPathPreviewController {
741
+ /** 设置选中的航点(高亮显示)*/
742
+ setSelectedWaypoint: (index: number | null) => void;
743
+ /** 获取当前选中的航点索引 */
744
+ getSelectedWaypoint: () => number | null;
745
+ /** 销毁控制器(移除事件监听等)*/
746
+ destroy: () => void;
747
+ }
748
+ /**
749
+ * 预览模式渲染飞航路线:支持航点点击高亮
750
+ *
751
+ * 与 renderFlightPath 不同,此函数返回一个控制器对象,支持:
752
+ * - 航点点击事件回调
753
+ * - 程序化设置选中航点(高亮显示)
754
+ * - 列表与地图双向联动
755
+ *
756
+ * @param CesiumNS Cesium 命名空间
757
+ * @param viewer Cesium Viewer 实例
758
+ * @param options 预览选项
759
+ * @returns 包含实体和控制器的对象
760
+ *
761
+ * @example
762
+ * ```typescript
763
+ * const { entity, controller } = renderFlightPathPreview(Cesium, viewer, {
764
+ * data: sinoflyData,
765
+ * onWaypointClick: (index, waypoint) => {
766
+ * console.log('点击了航点', index, waypoint);
767
+ * },
768
+ * initialSelectedIndex: 0
769
+ * });
770
+ *
771
+ * // 程序化设置选中航点
772
+ * controller.setSelectedWaypoint(2);
773
+ *
774
+ * // 销毁
775
+ * controller.destroy();
776
+ * ```
777
+ */
778
+ declare function renderFlightPathPreview(CesiumNS: typeof Cesium, viewer: Cesium.Viewer, options: RenderFlightPathPreviewOptions): {
779
+ entity: Entity$1;
780
+ controller: FlightPathPreviewController;
781
+ };
659
782
 
660
783
  type PathSample = {
661
784
  time: Cesium.JulianDate | Date | string | number;
@@ -741,6 +864,21 @@ declare class CZMLManager {
741
864
  * ```
742
865
  */
743
866
  renderFlightPath(options: RenderFlightPathOptions): Entity;
867
+ /**
868
+ * 预览模式渲染飞航路线:支持航点点击高亮
869
+ *
870
+ * 与 renderFlightPath 不同,此方法返回一个控制器对象,支持:
871
+ * - 航点点击事件回调
872
+ * - 程序化设置选中航点(高亮显示)
873
+ * - 列表与地图双向联动
874
+ *
875
+ * @param options 预览选项
876
+ * @returns 包含实体和控制器的对象
877
+ */
878
+ renderFlightPathPreview(options: RenderFlightPathPreviewOptions): {
879
+ entity: Entity;
880
+ controller: FlightPathPreviewController;
881
+ };
744
882
  addPathSample(entityOrId: Entity | string, sample: PathSample): void;
745
883
  addPathSamples(entityOrId: Entity | string, samples: PathSample[]): void;
746
884
  setPathSamples(entityOrId: Entity | string, samples: PathSample[]): void;
@@ -1912,4 +2050,4 @@ declare const placeholder: {
1912
2050
  ready: boolean;
1913
2051
  };
1914
2052
 
1915
- 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 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 QuickEditOptions, SceneManager, type SceneOptions, 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, toggle2D3D, version, versionInfo };
2053
+ 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 PathToSinoflyOptions, type PhotoBillboardItem, type PhotoBillboardLayerOptions, type PhotoBillboardResult, type PolygonDrawingOptions, type PolygonEditingSession, PolygonEditor, type PreviousViewChange, 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, 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 };
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
11
11
  // package.json
12
12
  var package_default = {
13
13
  name: "@jorgmoritz/gis-manager",
14
- version: "0.1.27"};
14
+ version: "0.1.28"};
15
15
 
16
16
  // src/utils/version.ts
17
17
  var version = package_default.version;
@@ -6736,6 +6736,98 @@ function renderFlightPath(CesiumNS, viewer, options) {
6736
6736
  }
6737
6737
  return entity;
6738
6738
  }
6739
+ function renderFlightPathPreview(CesiumNS, viewer, options) {
6740
+ const C = CesiumNS;
6741
+ const entity = renderFlightPath(CesiumNS, viewer, options);
6742
+ const vertexLabelManager = entity._vertexLabelManager;
6743
+ let selectedWaypointIndex = options.initialSelectedIndex ?? null;
6744
+ const polyline = entity.polyline;
6745
+ let positions = [];
6746
+ if (polyline && polyline.positions) {
6747
+ const posValue = polyline.positions.getValue?.(C.JulianDate.now());
6748
+ if (Array.isArray(posValue)) {
6749
+ positions = posValue;
6750
+ }
6751
+ }
6752
+ let waypointDataArray = [];
6753
+ try {
6754
+ const adapterOptions = {
6755
+ CesiumNS,
6756
+ ...options.adapterOptions
6757
+ };
6758
+ const converted = convertSinoflyWayline(options.data, adapterOptions);
6759
+ if (converted && converted.waypointData) {
6760
+ waypointDataArray = [...converted.waypointData].sort((a, b) => a.index - b.index);
6761
+ }
6762
+ } catch (e) {
6763
+ console.warn("[renderFlightPathPreview] \u65E0\u6CD5\u83B7\u53D6\u822A\u70B9\u6570\u636E:", e);
6764
+ }
6765
+ const hasHiddenClimb = entity.properties?._hasHiddenClimb?.getValue?.() ?? false;
6766
+ const hiddenClimbIndex = hasHiddenClimb ? 1 : void 0;
6767
+ const updateWaypointHighlight = (newIndex) => {
6768
+ if (!vertexLabelManager || positions.length === 0) return;
6769
+ const editedIndices = /* @__PURE__ */ new Set();
6770
+ vertexLabelManager.recreateAllLabels(positions, editedIndices, newIndex ?? void 0);
6771
+ };
6772
+ if (selectedWaypointIndex !== null) {
6773
+ updateWaypointHighlight(selectedWaypointIndex);
6774
+ }
6775
+ const handler = new C.ScreenSpaceEventHandler(viewer.scene.canvas);
6776
+ handler.setInputAction((movement) => {
6777
+ const pickedObject = viewer.scene.pick(movement.position);
6778
+ if (C.defined(pickedObject) && pickedObject.id) {
6779
+ const pickedEntity = pickedObject.id;
6780
+ const properties = pickedEntity.properties;
6781
+ if (properties) {
6782
+ const type = properties._type?.getValue?.(C.JulianDate.now());
6783
+ const ownerId = properties._ownerId?.getValue?.(C.JulianDate.now());
6784
+ const vertexIndex = properties._vertexIndex?.getValue?.(C.JulianDate.now());
6785
+ if (type === "vertex-label" && ownerId === entity.id && vertexIndex !== void 0) {
6786
+ let displayIndex = vertexIndex;
6787
+ if (hiddenClimbIndex === 1) {
6788
+ if (vertexIndex >= 2) {
6789
+ displayIndex = vertexIndex - 2;
6790
+ }
6791
+ } else {
6792
+ displayIndex = vertexIndex;
6793
+ }
6794
+ selectedWaypointIndex = vertexIndex;
6795
+ updateWaypointHighlight(selectedWaypointIndex);
6796
+ if (options.onWaypointClick) {
6797
+ const waypointData = waypointDataArray.find((wp) => wp.index === vertexIndex);
6798
+ options.onWaypointClick(displayIndex, waypointData);
6799
+ }
6800
+ }
6801
+ }
6802
+ }
6803
+ }, C.ScreenSpaceEventType.LEFT_CLICK);
6804
+ const controller = {
6805
+ setSelectedWaypoint: (index) => {
6806
+ if (index === null) {
6807
+ selectedWaypointIndex = null;
6808
+ updateWaypointHighlight(null);
6809
+ return;
6810
+ }
6811
+ let actualIndex = index;
6812
+ if (hiddenClimbIndex === 1) {
6813
+ actualIndex = index + 2;
6814
+ }
6815
+ selectedWaypointIndex = actualIndex;
6816
+ updateWaypointHighlight(selectedWaypointIndex);
6817
+ },
6818
+ getSelectedWaypoint: () => {
6819
+ if (selectedWaypointIndex === null) return null;
6820
+ if (hiddenClimbIndex === 1) {
6821
+ return selectedWaypointIndex >= 2 ? selectedWaypointIndex - 2 : null;
6822
+ }
6823
+ return selectedWaypointIndex;
6824
+ },
6825
+ destroy: () => {
6826
+ handler.destroy();
6827
+ }
6828
+ };
6829
+ return { entity, controller };
6830
+ }
6739
6831
 
6740
6832
  // src/core/CZMLPathManager.ts
6741
6833
  var _CZMLPathManager = class _CZMLPathManager {
@@ -6819,6 +6911,37 @@ var _CZMLPathManager = class _CZMLPathManager {
6819
6911
  renderFlightPath(options) {
6820
6912
  return renderFlightPath(this.CesiumNS, this.viewer, options);
6821
6913
  }
6914
+ /**
6915
+ * 预览模式渲染飞航路线:支持航点点击高亮
6916
+ *
6917
+ * 与 renderFlightPath 不同,此方法返回一个控制器对象,支持:
6918
+ * - 航点点击事件回调
6919
+ * - 程序化设置选中航点(高亮显示)
6920
+ * - 列表与地图双向联动
6921
+ *
6922
+ * @param options 预览选项
6923
+ * @returns 包含实体和控制器的对象
6924
+ *
6925
+ * @example
6926
+ * ```typescript
6927
+ * const { entity, controller } = pathManager.renderFlightPathPreview({
6928
+ * data: sinoflyData,
6929
+ * onWaypointClick: (index, waypoint) => {
6930
+ * console.log('点击了航点', index, waypoint);
6931
+ * },
6932
+ * initialSelectedIndex: 0
6933
+ * });
6934
+ *
6935
+ * // 程序化设置选中航点
6936
+ * controller.setSelectedWaypoint(2);
6937
+ *
6938
+ * // 销毁
6939
+ * controller.destroy();
6940
+ * ```
6941
+ */
6942
+ renderFlightPathPreview(options) {
6943
+ return renderFlightPathPreview(this.CesiumNS, this.viewer, options);
6944
+ }
6822
6945
  resolveEntity(entityOrId) {
6823
6946
  return typeof entityOrId === "string" ? this.viewer.entities.getById(entityOrId) : entityOrId;
6824
6947
  }
@@ -9708,6 +9831,20 @@ var CZMLManager = class {
9708
9831
  renderFlightPath(options) {
9709
9832
  return this.pathMgr.renderFlightPath(options);
9710
9833
  }
9834
+ /**
9835
+ * 预览模式渲染飞航路线:支持航点点击高亮
9836
+ *
9837
+ * 与 renderFlightPath 不同,此方法返回一个控制器对象,支持:
9838
+ * - 航点点击事件回调
9839
+ * - 程序化设置选中航点(高亮显示)
9840
+ * - 列表与地图双向联动
9841
+ *
9842
+ * @param options 预览选项
9843
+ * @returns 包含实体和控制器的对象
9844
+ */
9845
+ renderFlightPathPreview(options) {
9846
+ return this.pathMgr.renderFlightPathPreview(options);
9847
+ }
9711
9848
  addPathSample(entityOrId, sample) {
9712
9849
  return this.pathMgr.addPathSample(entityOrId, sample);
9713
9850
  }
@@ -10749,6 +10886,6 @@ function convertPathToSinofly(data, options) {
10749
10886
  // src/index.ts
10750
10887
  var placeholder = { ready: true };
10751
10888
 
10752
- export { CZMLManager, CameraEventBus, CameraFOVController, CameraManager, Emitter, FrustumPyramid, LayerManager, PolygonEditor, SceneManager, Selector, StateManager, assertCesiumAssetsConfigured, configureCesiumAssets, configureCesiumIonToken, convertPathToSinofly, convertSinoflyWayline, convertSinoflyWaylines, ensureCesiumIonToken, getCesiumBaseUrl, getCesiumIonToken, globalCameraEventBus, globalState, placeholder, toggle2D3D, version, versionInfo };
10889
+ export { CZMLManager, CameraEventBus, CameraFOVController, CameraManager, Emitter, FrustumPyramid, LayerManager, PolygonEditor, SceneManager, Selector, StateManager, assertCesiumAssetsConfigured, configureCesiumAssets, configureCesiumIonToken, convertPathToSinofly, convertSinoflyWayline, convertSinoflyWaylines, ensureCesiumIonToken, getCesiumBaseUrl, getCesiumIonToken, globalCameraEventBus, globalState, placeholder, renderFlightPath, renderFlightPathPreview, toggle2D3D, version, versionInfo };
10753
10890
  //# sourceMappingURL=index.js.map
10754
10891
  //# sourceMappingURL=index.js.map