@jorgmoritz/gis-manager 0.1.33 → 0.1.35

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/vue/index.js CHANGED
@@ -2770,6 +2770,8 @@ var AirplaneCursor = class {
2770
2770
  __publicField(this, "angleStep");
2771
2771
  /** 加速倍率(按住 Shift 生效) */
2772
2772
  __publicField(this, "fastFactor");
2773
+ /** 最小高度(米) */
2774
+ __publicField(this, "minHeight");
2773
2775
  /** 外部传入的行为配置与回调 */
2774
2776
  __publicField(this, "opts");
2775
2777
  // 使用内联的 _FrustumPyramid
@@ -2797,6 +2799,7 @@ var AirplaneCursor = class {
2797
2799
  this.step = opts.stepMeters ?? 2;
2798
2800
  this.angleStep = opts.angleStepDeg ?? 1;
2799
2801
  this.fastFactor = opts.fastFactor ?? 5;
2802
+ this.minHeight = opts.minHeight ?? 0;
2800
2803
  this.currentFOV = opts.fovDeg ?? 50;
2801
2804
  this.ensureEntity(opts.color ?? C.Color.CYAN.withAlpha(0.9));
2802
2805
  this.attachKeyboard(opts);
@@ -3020,8 +3023,12 @@ var AirplaneCursor = class {
3020
3023
  moved = true;
3021
3024
  }
3022
3025
  if (this.keysPressed.has("z")) {
3023
- setPos(addVec(pose.position, C.Cartesian3.multiplyByScalar(u3, -step, new C.Cartesian3())));
3024
- moved = true;
3026
+ const newPos = addVec(pose.position, C.Cartesian3.multiplyByScalar(u3, -step, new C.Cartesian3()));
3027
+ const newCarto = C.Cartographic.fromCartesian(newPos);
3028
+ if (newCarto && newCarto.height >= this.minHeight) {
3029
+ setPos(newPos);
3030
+ moved = true;
3031
+ }
3025
3032
  }
3026
3033
  if (this.keysPressed.has("q")) {
3027
3034
  pose.heading = clampDeg(pose.heading - ang);
@@ -3894,6 +3901,7 @@ var VertexDragHandler = class {
3894
3901
  __publicField(this, "CesiumNS");
3895
3902
  __publicField(this, "viewer");
3896
3903
  __publicField(this, "hiddenClimbIndex");
3904
+ __publicField(this, "minHeight");
3897
3905
  __publicField(this, "callbacks");
3898
3906
  __publicField(this, "dragState", null);
3899
3907
  __publicField(this, "canvas");
@@ -3902,6 +3910,7 @@ var VertexDragHandler = class {
3902
3910
  this.CesiumNS = options.CesiumNS;
3903
3911
  this.viewer = options.viewer;
3904
3912
  this.hiddenClimbIndex = options.hiddenClimbIndex;
3913
+ this.minHeight = options.minHeight ?? 0;
3905
3914
  this.callbacks = callbacks;
3906
3915
  this.canvas = this.viewer.scene.canvas;
3907
3916
  this.setupKeyboardListeners();
@@ -4077,7 +4086,7 @@ var VertexDragHandler = class {
4077
4086
  const cameraHeight = this.viewer.camera.positionCartographic.height;
4078
4087
  const scaleFactor = Math.max(cameraHeight / 1e3, 0.5);
4079
4088
  const heightDelta = -deltaY * scaleFactor;
4080
- const newHeight = Math.max(0, this.dragState.startHeight + heightDelta);
4089
+ const newHeight = Math.max(this.minHeight, this.dragState.startHeight + heightDelta);
4081
4090
  const newPosition = C.Cartesian3.fromDegrees(
4082
4091
  this.dragState.startLonLat.lon,
4083
4092
  this.dragState.startLonLat.lat,
@@ -4184,7 +4193,8 @@ var PathEditingEventHandler = class {
4184
4193
  {
4185
4194
  CesiumNS: this.CesiumNS,
4186
4195
  viewer: this.viewer,
4187
- hiddenClimbIndex: this.hiddenClimbIndex
4196
+ hiddenClimbIndex: this.hiddenClimbIndex,
4197
+ minHeight: options.minHeight
4188
4198
  },
4189
4199
  {
4190
4200
  onDragStart: (index) => {
@@ -5235,7 +5245,9 @@ function startPathEditing(CesiumNS, viewer, entityOrId, options) {
5235
5245
  }
5236
5246
  },
5237
5247
  // frustumLengthFactor: options?.preview?.lengthFactor ?? 0.3,
5238
- fovDeg: options?.preview?.fov ?? 50
5248
+ fovDeg: options?.preview?.fov ?? 50,
5249
+ minHeight: options?.minHeight
5250
+ // 传递最小高度限制
5239
5251
  });
5240
5252
  if (options?.preview?.enabled !== false && airplaneCursor) {
5241
5253
  preview = new PathPreview(CesiumNS, viewer, {
@@ -5279,7 +5291,8 @@ function startPathEditing(CesiumNS, viewer, entityOrId, options) {
5279
5291
  {
5280
5292
  CesiumNS,
5281
5293
  viewer,
5282
- hiddenClimbIndex
5294
+ hiddenClimbIndex,
5295
+ minHeight: options?.minHeight
5283
5296
  },
5284
5297
  {
5285
5298
  onVertexSelect: (index) => setActiveIndex(index),