@jorgmoritz/gis-manager 0.1.30 → 0.1.31

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.
@@ -3023,7 +3023,20 @@ var AirplaneCursor = class {
3023
3023
  moved = true;
3024
3024
  }
3025
3025
  if (this.keysPressed.has("z")) {
3026
- setPos(addVec(pose.position, C.Cartesian3.multiplyByScalar(u3, -step, new C.Cartesian3())));
3026
+ const newPos = addVec(pose.position, C.Cartesian3.multiplyByScalar(u3, -step, new C.Cartesian3()));
3027
+ const cartographic = C.Cartographic.fromCartesian(newPos);
3028
+ if (cartographic) {
3029
+ const terrainHeight = this.viewer.scene.globe.getHeight(cartographic) ?? 0;
3030
+ const minAltitude = terrainHeight + 1;
3031
+ if (cartographic.height < minAltitude) {
3032
+ cartographic.height = minAltitude;
3033
+ setPos(C.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height));
3034
+ } else {
3035
+ setPos(newPos);
3036
+ }
3037
+ } else {
3038
+ setPos(newPos);
3039
+ }
3027
3040
  moved = true;
3028
3041
  }
3029
3042
  if (this.keysPressed.has("q")) {