@jorgmoritz/gis-manager 0.1.38 → 0.1.40

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
@@ -2473,5 +2473,6 @@ declare class PathSafetyChecker {
2473
2473
  declare const placeholder: {
2474
2474
  ready: boolean;
2475
2475
  };
2476
+ declare const droneModelUrl: string;
2476
2477
 
2477
- export { type AltitudeMode, 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, FlightSimulator, type FlightSimulatorController, type FlightSimulatorOptions, type FlightSimulatorState, type FlightSimulatorStateChangeEvent, 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 PointCloudPickResult, type PointCloudPickSession, PointCloudPicker, type PointCloudPickerOptions, 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, calculateAbsoluteHeight, calculateRelativeHeight, configureCesiumAssets, configureCesiumIonToken, convertPathToSinofly, convertSinoflyWayline, convertSinoflyWaylines, ensureCesiumIonToken, getCesiumBaseUrl, getCesiumIonToken, globalCameraEventBus, globalState, placeholder, queryTerrainHeightAsync, queryTerrainHeightSync, queryTerrainHeights, renderFlightPath, renderFlightPathPreview, toggle2D3D, version, versionInfo };
2478
+ export { type AltitudeMode, 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, FlightSimulator, type FlightSimulatorController, type FlightSimulatorOptions, type FlightSimulatorState, type FlightSimulatorStateChangeEvent, 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 PointCloudPickResult, type PointCloudPickSession, PointCloudPicker, type PointCloudPickerOptions, 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, calculateAbsoluteHeight, calculateRelativeHeight, configureCesiumAssets, configureCesiumIonToken, convertPathToSinofly, convertSinoflyWayline, convertSinoflyWaylines, droneModelUrl, ensureCesiumIonToken, getCesiumBaseUrl, getCesiumIonToken, globalCameraEventBus, globalState, placeholder, queryTerrainHeightAsync, queryTerrainHeightSync, queryTerrainHeights, renderFlightPath, renderFlightPathPreview, toggle2D3D, version, versionInfo };
package/dist/index.d.ts CHANGED
@@ -2473,5 +2473,6 @@ declare class PathSafetyChecker {
2473
2473
  declare const placeholder: {
2474
2474
  ready: boolean;
2475
2475
  };
2476
+ declare const droneModelUrl: string;
2476
2477
 
2477
- export { type AltitudeMode, 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, FlightSimulator, type FlightSimulatorController, type FlightSimulatorOptions, type FlightSimulatorState, type FlightSimulatorStateChangeEvent, 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 PointCloudPickResult, type PointCloudPickSession, PointCloudPicker, type PointCloudPickerOptions, 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, calculateAbsoluteHeight, calculateRelativeHeight, configureCesiumAssets, configureCesiumIonToken, convertPathToSinofly, convertSinoflyWayline, convertSinoflyWaylines, ensureCesiumIonToken, getCesiumBaseUrl, getCesiumIonToken, globalCameraEventBus, globalState, placeholder, queryTerrainHeightAsync, queryTerrainHeightSync, queryTerrainHeights, renderFlightPath, renderFlightPathPreview, toggle2D3D, version, versionInfo };
2478
+ export { type AltitudeMode, 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, FlightSimulator, type FlightSimulatorController, type FlightSimulatorOptions, type FlightSimulatorState, type FlightSimulatorStateChangeEvent, 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 PointCloudPickResult, type PointCloudPickSession, PointCloudPicker, type PointCloudPickerOptions, 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, calculateAbsoluteHeight, calculateRelativeHeight, configureCesiumAssets, configureCesiumIonToken, convertPathToSinofly, convertSinoflyWayline, convertSinoflyWaylines, droneModelUrl, ensureCesiumIonToken, getCesiumBaseUrl, getCesiumIonToken, globalCameraEventBus, globalState, placeholder, queryTerrainHeightAsync, queryTerrainHeightSync, queryTerrainHeights, 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.37"};
14
+ version: "0.1.40"};
15
15
 
16
16
  // src/utils/version.ts
17
17
  var version = package_default.version;
@@ -1551,6 +1551,11 @@ var HeightMarker = class {
1551
1551
  }
1552
1552
  };
1553
1553
 
1554
+ // src/core/path-manager/constants.ts
1555
+ var DEFAULT_FOV = 172;
1556
+ var SENSOR_WIDTH = 36;
1557
+ var FOCAL_LENGTH_PRESETS = [112, 56, 14, 7, 3, 1];
1558
+
1554
1559
  // src/core/path-manager/CameraFOVController.ts
1555
1560
  var CameraFOVController = class {
1556
1561
  constructor(opts = {}) {
@@ -1582,8 +1587,8 @@ var CameraFOVController = class {
1582
1587
  this.updateDisplay();
1583
1588
  this.emitChange();
1584
1589
  });
1585
- this.sensorWidth = opts.sensorWidth ?? 36;
1586
- this.focalLengthPresets = opts.focalLengthPresets ?? [112, 56, 14, 7, 3, 1];
1590
+ this.sensorWidth = opts.sensorWidth ?? SENSOR_WIDTH;
1591
+ this.focalLengthPresets = opts.focalLengthPresets ?? FOCAL_LENGTH_PRESETS;
1587
1592
  if (opts.minFOV === void 0 || opts.maxFOV === void 0) {
1588
1593
  const minFocalLength = Math.min(...this.focalLengthPresets);
1589
1594
  const maxFocalLength = Math.max(...this.focalLengthPresets);
@@ -1593,7 +1598,7 @@ var CameraFOVController = class {
1593
1598
  this.minFOV = opts.minFOV;
1594
1599
  this.maxFOV = opts.maxFOV;
1595
1600
  }
1596
- this.currentFOV = opts.initialFOV ?? this.focalLengthToFOVDirect(56);
1601
+ this.currentFOV = opts.initialFOV ?? DEFAULT_FOV;
1597
1602
  this.useGlobalEventBus = opts.useGlobalEventBus ?? true;
1598
1603
  this.createUI();
1599
1604
  this.setupExternalFOVListener();
@@ -1943,7 +1948,7 @@ var CameraFOVController = class {
1943
1948
 
1944
1949
  // src/core/path-manager/PathPreview.ts
1945
1950
  var PathPreview = class {
1946
- // 当前 FOV 值
1951
+ // 折叠按钮
1947
1952
  constructor(CesiumNS, mainViewer, opts = {}) {
1948
1953
  this.CesiumNS = CesiumNS;
1949
1954
  this.mainViewer = mainViewer;
@@ -1952,16 +1957,18 @@ var PathPreview = class {
1952
1957
  // Lightweight overlay viewer
1953
1958
  __publicField(this, "containerEl");
1954
1959
  // Container for the overlay viewer
1955
- __publicField(this, "footprintEntity");
1956
- // Entity for ground footprint polygon
1957
1960
  __publicField(this, "destroyed", false);
1958
1961
  // Track if the instance has been destroyed
1959
1962
  __publicField(this, "fovController");
1960
1963
  // FOV 控制器
1961
1964
  __publicField(this, "currentFOV");
1965
+ // 当前 FOV 值
1966
+ __publicField(this, "collapsed", false);
1967
+ // 折叠状态
1968
+ __publicField(this, "toggleBtn");
1962
1969
  /** 已加载的 3D Tiles 实例(预览窗口独立的) */
1963
1970
  __publicField(this, "tilesets", /* @__PURE__ */ new Map());
1964
- this.currentFOV = opts.fov ?? 50;
1971
+ this.currentFOV = opts.fov ?? DEFAULT_FOV;
1965
1972
  this.ensureViewer();
1966
1973
  this.ensureFOVController();
1967
1974
  }
@@ -1973,9 +1980,9 @@ var PathPreview = class {
1973
1980
  host = document.createElement("div");
1974
1981
  host.style.position = "absolute";
1975
1982
  host.style.right = "10px";
1976
- host.style.bottom = "10px";
1977
- host.style.width = "480px";
1978
- host.style.height = "320px";
1983
+ host.style.bottom = "80px";
1984
+ host.style.width = "320px";
1985
+ host.style.height = "200px";
1979
1986
  host.style.border = "1px solid rgba(255, 255, 255, 1)";
1980
1987
  host.style.borderRadius = "6px";
1981
1988
  host.style.overflow = "hidden";
@@ -1985,6 +1992,7 @@ var PathPreview = class {
1985
1992
  parent?.appendChild(host);
1986
1993
  } catch {
1987
1994
  }
1995
+ this.createToggleButton(host);
1988
1996
  }
1989
1997
  this.containerEl = host;
1990
1998
  const v = new C.Viewer(host, {
@@ -2019,6 +2027,157 @@ var PathPreview = class {
2019
2027
  this.syncFromMainViewer();
2020
2028
  this.disableUserInteraction();
2021
2029
  }
2030
+ /**
2031
+ * 创建折叠按钮
2032
+ */
2033
+ createToggleButton(container) {
2034
+ if (typeof document === "undefined") return;
2035
+ this.toggleBtn = document.createElement("div");
2036
+ this.toggleBtn.style.cssText = `
2037
+ position: absolute;
2038
+ top: 6px;
2039
+ left: 6px;
2040
+ width: 24px;
2041
+ height: 24px;
2042
+ background: rgba(0, 0, 0, 0.6);
2043
+ border: 1px solid rgba(255, 255, 255, 0.5);
2044
+ border-radius: 4px;
2045
+ cursor: pointer;
2046
+ z-index: 20;
2047
+ display: flex;
2048
+ align-items: center;
2049
+ justify-content: center;
2050
+ transition: all 0.2s;
2051
+ pointer-events: auto;
2052
+ `;
2053
+ this.toggleBtn.innerHTML = `
2054
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="white" style="transition: transform 0.2s;">
2055
+ <path d="M4 2 L8 6 L4 10" stroke="white" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
2056
+ </svg>
2057
+ `;
2058
+ this.toggleBtn.addEventListener("mouseenter", () => {
2059
+ if (this.toggleBtn) {
2060
+ this.toggleBtn.style.background = "rgba(47, 119, 251, 0.8)";
2061
+ }
2062
+ });
2063
+ this.toggleBtn.addEventListener("mouseleave", () => {
2064
+ if (this.toggleBtn) {
2065
+ this.toggleBtn.style.background = "rgba(0, 0, 0, 0.6)";
2066
+ }
2067
+ });
2068
+ this.toggleBtn.addEventListener("click", (e) => {
2069
+ e.stopPropagation();
2070
+ this.toggle();
2071
+ });
2072
+ container.appendChild(this.toggleBtn);
2073
+ }
2074
+ /**
2075
+ * 切换折叠状态
2076
+ */
2077
+ toggle() {
2078
+ if (this.collapsed) {
2079
+ this.expand();
2080
+ } else {
2081
+ this.collapse();
2082
+ }
2083
+ }
2084
+ /**
2085
+ * 折叠预览窗口
2086
+ */
2087
+ collapse() {
2088
+ if (this.collapsed || !this.containerEl) return;
2089
+ this.collapsed = true;
2090
+ this.containerEl.dataset.originalWidth = this.containerEl.style.width;
2091
+ this.containerEl.dataset.originalHeight = this.containerEl.style.height;
2092
+ this.containerEl.style.width = "36px";
2093
+ this.containerEl.style.height = "36px";
2094
+ this.containerEl.style.overflow = "hidden";
2095
+ if (this.overlayViewer) {
2096
+ const viewerContainer = this.overlayViewer.container;
2097
+ if (viewerContainer) {
2098
+ viewerContainer.style.display = "none";
2099
+ }
2100
+ }
2101
+ this.hideFOVController();
2102
+ if (this.toggleBtn) {
2103
+ this.toggleBtn.style.cssText = `
2104
+ position: absolute;
2105
+ top: 2px;
2106
+ left: 2px;
2107
+ right: 2px;
2108
+ bottom: 2px;
2109
+ width: auto;
2110
+ height: auto;
2111
+ background: rgba(47, 119, 251, 0.9);
2112
+ border: 1px solid rgba(255, 255, 255, 0.8);
2113
+ border-radius: 4px;
2114
+ cursor: pointer;
2115
+ z-index: 20;
2116
+ display: flex;
2117
+ align-items: center;
2118
+ justify-content: center;
2119
+ transition: all 0.2s;
2120
+ pointer-events: auto;
2121
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
2122
+ `;
2123
+ this.toggleBtn.innerHTML = `
2124
+ <svg width="16" height="16" viewBox="0 0 12 12" fill="white">
2125
+ <path d="M8 2 L4 6 L8 10" stroke="white" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
2126
+ </svg>
2127
+ `;
2128
+ }
2129
+ this.containerEl.style.display = "block";
2130
+ }
2131
+ /**
2132
+ * 展开预览窗口
2133
+ */
2134
+ expand() {
2135
+ if (!this.collapsed || !this.containerEl) return;
2136
+ this.collapsed = false;
2137
+ this.containerEl.style.width = this.containerEl.dataset.originalWidth || "320px";
2138
+ this.containerEl.style.height = this.containerEl.dataset.originalHeight || "200px";
2139
+ if (this.overlayViewer) {
2140
+ const viewerContainer = this.overlayViewer.container;
2141
+ if (viewerContainer) {
2142
+ viewerContainer.style.display = "block";
2143
+ }
2144
+ }
2145
+ this.showFOVController();
2146
+ if (this.toggleBtn) {
2147
+ this.toggleBtn.style.cssText = `
2148
+ position: absolute;
2149
+ top: 6px;
2150
+ left: 6px;
2151
+ width: 24px;
2152
+ height: 24px;
2153
+ background: rgba(0, 0, 0, 0.6);
2154
+ border: 1px solid rgba(255, 255, 255, 0.5);
2155
+ border-radius: 4px;
2156
+ cursor: pointer;
2157
+ z-index: 20;
2158
+ display: flex;
2159
+ align-items: center;
2160
+ justify-content: center;
2161
+ transition: all 0.2s;
2162
+ pointer-events: auto;
2163
+ `;
2164
+ this.toggleBtn.innerHTML = `
2165
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="white">
2166
+ <path d="M4 2 L8 6 L4 10" stroke="white" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
2167
+ </svg>
2168
+ `;
2169
+ }
2170
+ try {
2171
+ this.overlayViewer?.scene?.requestRender?.();
2172
+ } catch {
2173
+ }
2174
+ }
2175
+ /**
2176
+ * 获取折叠状态
2177
+ */
2178
+ isCollapsed() {
2179
+ return this.collapsed;
2180
+ }
2022
2181
  /**
2023
2182
  * 从主 viewer 同步配置
2024
2183
  * 共享 Provider(安全)而非 DataSource
@@ -2274,28 +2433,6 @@ var PathPreview = class {
2274
2433
  console.warn("[PathPreview] Failed to update FOV:", e);
2275
2434
  }
2276
2435
  }
2277
- // private ensureFootprint(): void {
2278
- // const C: any = this.CesiumNS as any;
2279
- // if (this.footprintEntity) return;
2280
- // this.footprintEntity = (this.layer.entities as any).add({
2281
- // polygon: {
2282
- // // Only show when we have at least 3 ground hit points
2283
- // show: new C.CallbackProperty(() => (this._footprintPositions?.length ?? 0) >= 3, false),
2284
- // hierarchy: new C.CallbackProperty(() => {
2285
- // const arr = this._footprintPositions;
2286
- // return arr && arr.length >= 3 ? arr.slice() : undefined;
2287
- // }, false),
2288
- // material: C.Color.CYAN.withAlpha(0.18),
2289
- // outline: true,
2290
- // outlineColor: C.Color.CYAN.withAlpha(0.7),
2291
- // outlineWidth: 1,
2292
- // // Use per-position heights from globe intersections to avoid terrain-ground primitive path
2293
- // perPositionHeight: true,
2294
- // },
2295
- // properties: { _type: 'preview-footprint' },
2296
- // });
2297
- // }
2298
- // private _footprintPositions: any[] | undefined;
2299
2436
  /**
2300
2437
  * Set the camera pose and field of view for the overlay viewer.
2301
2438
  * @param cartesian cartesian position
@@ -2315,29 +2452,6 @@ var PathPreview = class {
2315
2452
  orientation: { heading: h, pitch: p, roll: r }
2316
2453
  });
2317
2454
  }
2318
- // // Recompute footprint using overlay scene
2319
- // try {
2320
- // const scene: any = v.scene;
2321
- // const w = scene?.canvas?.width ?? 256;
2322
- // const hgt = scene?.canvas?.height ?? 144;
2323
- // const corners = [
2324
- // new C.Cartesian2(2, 2),
2325
- // new C.Cartesian2(w - 2, 2),
2326
- // new C.Cartesian2(w - 2, hgt - 2),
2327
- // new C.Cartesian2(2, hgt - 2),
2328
- // ];
2329
- // const pts: any[] = [];
2330
- // for (const c of corners) {
2331
- // const ray = v.camera.getPickRay(c);
2332
- // if (!ray) continue;
2333
- // const hit = scene.globe?.pick?.(ray, scene);
2334
- // if (hit) pts.push(hit);
2335
- // }
2336
- // // this._footprintPositions = pts.length >= 3 ? pts : undefined;
2337
- // v.scene?.requestRender?.();
2338
- // (this.mainViewer.scene as any)?.requestRender?.();
2339
- // } catch {}
2340
- // }
2341
2455
  /**
2342
2456
  * 设置 FOV(如果启用了 FOV 控制器)
2343
2457
  */
@@ -2404,7 +2518,11 @@ var PathPreview = class {
2404
2518
  } catch {
2405
2519
  }
2406
2520
  this.fovController = void 0;
2407
- this.footprintEntity = void 0;
2521
+ try {
2522
+ this.toggleBtn?.remove();
2523
+ } catch {
2524
+ }
2525
+ this.toggleBtn = void 0;
2408
2526
  try {
2409
2527
  this.tilesets.forEach((tileset) => {
2410
2528
  try {
@@ -2458,7 +2576,7 @@ var FrustumPyramid = class {
2458
2576
  */
2459
2577
  computeFrustumGeometry(apex, headingDeg, pitchDeg, rollDeg, fovDeg, length) {
2460
2578
  const C = this.CesiumNS;
2461
- const fov = Math.max(1, Math.min(120, fovDeg ?? this.opts.fov ?? 50));
2579
+ const fov = Math.max(1, Math.min(120, fovDeg ?? this.opts.fov ?? DEFAULT_FOV));
2462
2580
  const aspectRatio = this.opts.aspectRatio ?? 4 / 3;
2463
2581
  const halfFovH = C.Math.toRadians(fov / 2);
2464
2582
  const halfWidth = Math.tan(halfFovH) * length;
@@ -2637,7 +2755,7 @@ var FrustumPyramid = class {
2637
2755
  const lakeFill = (this.opts.fillColor ?? C.Color.fromCssColorString("#1e90ff")).withAlpha(alpha);
2638
2756
  const width = this.opts.width ?? 3;
2639
2757
  this.ensureEntities(lakeEdge, width, lakeFill);
2640
- const effectiveFov = Math.max(1, Math.min(120, fovDeg ?? this.opts.fov ?? 50));
2758
+ const effectiveFov = Math.max(1, Math.min(120, fovDeg ?? this.opts.fov ?? DEFAULT_FOV));
2641
2759
  const aspectRatio = this.opts.aspectRatio ?? 4 / 3;
2642
2760
  this.logAnglesIfChanged(effectiveFov, aspectRatio, headingDeg, pitchDeg);
2643
2761
  const { apex: apexPos, corners, baseCenter } = this.computeFrustumGeometry(
@@ -2841,7 +2959,7 @@ var AirplaneCursor = class {
2841
2959
  this.step = opts.stepMeters ?? 2;
2842
2960
  this.angleStep = opts.angleStepDeg ?? 1;
2843
2961
  this.fastFactor = opts.fastFactor ?? 5;
2844
- this.currentFOV = opts.fovDeg ?? 50;
2962
+ this.currentFOV = opts.fovDeg ?? DEFAULT_FOV;
2845
2963
  this.ensureEntity(opts.color ?? C.Color.CYAN.withAlpha(0.9));
2846
2964
  this.attachKeyboard(opts);
2847
2965
  this.setupFOVListener();
@@ -3119,7 +3237,8 @@ var AirplaneCursor = class {
3119
3237
  this.viewer.dataSources.add(layer);
3120
3238
  }
3121
3239
  this.frustum = new FrustumPyramid(this.CesiumNS, layer, {
3122
- fov: this.opts.fovDeg ?? 40,
3240
+ fov: this.opts.fovDeg ?? DEFAULT_FOV,
3241
+ // 使用统一的默认 FOV
3123
3242
  length: 80,
3124
3243
  color: this.opts.color,
3125
3244
  fillAlpha: 0.25,
@@ -3128,8 +3247,8 @@ var AirplaneCursor = class {
3128
3247
  logAngles: false,
3129
3248
  logThrottleMs: 300
3130
3249
  });
3131
- const frustumFovScale = 0.6;
3132
- const frustumLengthScale = 0.1;
3250
+ const frustumFovScale = 0.5;
3251
+ const frustumLengthScale = 0.2;
3133
3252
  this.frustum.showAtDynamic(
3134
3253
  () => this.pose.position,
3135
3254
  () => this.pose.heading,
@@ -5214,11 +5333,11 @@ function startPathEditing(CesiumNS, viewer, entityOrId, options) {
5214
5333
  const fArr = getArr("_vertexFov");
5215
5334
  pitches[i] = typeof pArr?.[i] === "number" ? pArr[i] : -10;
5216
5335
  rolls[i] = typeof rArr?.[i] === "number" ? rArr[i] : 0;
5217
- fovs[i] = typeof fArr?.[i] === "number" ? fArr[i] : 50;
5336
+ fovs[i] = typeof fArr?.[i] === "number" ? fArr[i] : DEFAULT_FOV;
5218
5337
  } catch {
5219
5338
  pitches[i] = -10;
5220
5339
  rolls[i] = 0;
5221
- fovs[i] = 50;
5340
+ fovs[i] = DEFAULT_FOV;
5222
5341
  }
5223
5342
  }
5224
5343
  entity.polyline.positions = new C.CallbackProperty(() => positions.slice(), false);
@@ -5247,7 +5366,7 @@ function startPathEditing(CesiumNS, viewer, entityOrId, options) {
5247
5366
  headings[activeIndex] ?? 0,
5248
5367
  pitches[activeIndex] ?? -10,
5249
5368
  0,
5250
- fovs[activeIndex] ?? 50
5369
+ fovs[activeIndex] ?? DEFAULT_FOV
5251
5370
  );
5252
5371
  }
5253
5372
  } catch {
@@ -5423,13 +5542,13 @@ function startPathEditing(CesiumNS, viewer, entityOrId, options) {
5423
5542
  }
5424
5543
  },
5425
5544
  // frustumLengthFactor: options?.preview?.lengthFactor ?? 0.3,
5426
- fovDeg: options?.preview?.fov ?? 50
5545
+ fovDeg: options?.preview?.fov ?? DEFAULT_FOV
5427
5546
  });
5428
5547
  if (options?.preview?.enabled !== false && airplaneCursor) {
5429
5548
  preview = new PathPreview(CesiumNS, viewer, {
5430
5549
  container: options?.preview?.container,
5431
5550
  showFootprint: options?.preview?.showFootprint ?? false,
5432
- fov: options?.preview?.fov ?? 50,
5551
+ fov: options?.preview?.fov ?? DEFAULT_FOV,
5433
5552
  pitch: options?.preview?.pitch ?? -10,
5434
5553
  roll: options?.preview?.roll ?? 0
5435
5554
  });
@@ -5441,7 +5560,7 @@ function startPathEditing(CesiumNS, viewer, entityOrId, options) {
5441
5560
  initialPose.heading,
5442
5561
  initialPose.pitch,
5443
5562
  initialPose.roll,
5444
- options?.preview?.fov ?? 50
5563
+ options?.preview?.fov ?? DEFAULT_FOV
5445
5564
  );
5446
5565
  } catch {
5447
5566
  console.warn("PathEditing: failed to set initial preview pose");
@@ -5699,7 +5818,7 @@ function startPathEditing(CesiumNS, viewer, entityOrId, options) {
5699
5818
  heading: headings[index] ?? 0,
5700
5819
  pitch: pitches[index] ?? 0,
5701
5820
  roll: rolls[index] ?? 0,
5702
- fov: fovs[index] ?? 50
5821
+ fov: fovs[index] ?? DEFAULT_FOV
5703
5822
  };
5704
5823
  const totalVertices = positions.length;
5705
5824
  const totalVisibleVertices = totalVertices;
@@ -5773,7 +5892,7 @@ function startPathEditing(CesiumNS, viewer, entityOrId, options) {
5773
5892
  heading: headings[index] ?? 0,
5774
5893
  pitch: pitches[index] ?? -10,
5775
5894
  roll: rolls[index] ?? 0,
5776
- fov: fovs[index] ?? 50,
5895
+ fov: fovs[index] ?? DEFAULT_FOV,
5777
5896
  index,
5778
5897
  distance: calculatePathDistance(CesiumNS, positions, index),
5779
5898
  ellipsoidHeight,
@@ -6243,7 +6362,7 @@ function startPathDrawing(CesiumNS, viewer, options, onComplete) {
6243
6362
  try {
6244
6363
  const auto = options?.autoStartEditing;
6245
6364
  const editOptions = {
6246
- // 🔧 默认使用自由编辑模式(快速编辑和自由编辑互斥)
6365
+ // 默认使用自由编辑模式(快速编辑和自由编辑互斥)
6247
6366
  quickEdit: false
6248
6367
  };
6249
6368
  if (typeof auto === "object" && auto.preview) {
@@ -11711,7 +11830,8 @@ var PathSafetyChecker = class {
11711
11830
 
11712
11831
  // src/index.ts
11713
11832
  var placeholder = { ready: true };
11833
+ var droneModelUrl = wurenji_default;
11714
11834
 
11715
- export { CZMLManager, CameraEventBus, CameraFOVController, CameraManager, Emitter, FlightSimulator, FrustumPyramid, LayerManager, PathSafetyChecker, PointCloudPicker, PolygonEditor, SceneManager, Selector, StateManager, assertCesiumAssetsConfigured, calculateAbsoluteHeight, calculateRelativeHeight, configureCesiumAssets, configureCesiumIonToken, convertPathToSinofly, convertSinoflyWayline, convertSinoflyWaylines, ensureCesiumIonToken, getCesiumBaseUrl, getCesiumIonToken, globalCameraEventBus, globalState, placeholder, queryTerrainHeightAsync, queryTerrainHeightSync, queryTerrainHeights, renderFlightPath, renderFlightPathPreview, toggle2D3D, version, versionInfo };
11835
+ export { CZMLManager, CameraEventBus, CameraFOVController, CameraManager, Emitter, FlightSimulator, FrustumPyramid, LayerManager, PathSafetyChecker, PointCloudPicker, PolygonEditor, SceneManager, Selector, StateManager, assertCesiumAssetsConfigured, calculateAbsoluteHeight, calculateRelativeHeight, configureCesiumAssets, configureCesiumIonToken, convertPathToSinofly, convertSinoflyWayline, convertSinoflyWaylines, droneModelUrl, ensureCesiumIonToken, getCesiumBaseUrl, getCesiumIonToken, globalCameraEventBus, globalState, placeholder, queryTerrainHeightAsync, queryTerrainHeightSync, queryTerrainHeights, renderFlightPath, renderFlightPathPreview, toggle2D3D, version, versionInfo };
11716
11836
  //# sourceMappingURL=index.js.map
11717
11837
  //# sourceMappingURL=index.js.map