瀏覽代碼

edit anchor add params

tags/4.0.0
cavencj 1 年之前
父節點
當前提交
3f10a24b78
共有 2 個檔案被更改,包括 14 行新增11 行删除
  1. 11
    10
      src/modules/tools/DrawTool.js
  2. 3
    1
      src/modules/tools/EditTool.js

+ 11
- 10
src/modules/tools/DrawTool.js 查看文件

@@ -30,15 +30,14 @@ class DrawTool {
}

_getEventPosition(e) {
const { overlay, layer, position, surfacePosition } = e;
const { overlay, layer, position, surfacePosition } = e
if (!this._options.clampToModel) {
return surfacePosition;
return surfacePosition
}
if (!overlay && !layer) {
return surfacePosition;
return surfacePosition
}
return position;

return position
}

/**
@@ -48,7 +47,7 @@ class DrawTool {
* @private
*/
_onClick(e) {
let position = this._getEventPosition(e);
let position = this._getEventPosition(e)
if (!position) {
return false
}
@@ -65,7 +64,7 @@ class DrawTool {
*/
_onMouseMove(e) {
this._viewer.tooltip.showAt(e.windowPosition, this._tooltipMess)
let position = this._getEventPosition(e);
let position = this._getEventPosition(e)
if (!position) {
return false
}
@@ -79,7 +78,7 @@ class DrawTool {
* @private
*/
_onRightClick(e) {
this._plotEvent.fire(PlotEventType.DRAW_STOP, this._getEventPosition(e));
this._plotEvent.fire(PlotEventType.DRAW_STOP, this._getEventPosition(e))
}

/**
@@ -96,10 +95,12 @@ class DrawTool {
image: isCenter ? this._options.icon_center : this._options.icon_anchor,
width: this._options.icon_size[0],
height: this._options.icon_size[1],
eyeOffset: new Cesium.Cartesian3(0, 0, -100),
pixelOffset: this._options.pixelOffset || new Cesium.Cartesian2(0, 0),
eyeOffset: this._options.eyeOffset || new Cesium.Cartesian3(0, 0, -100),
disableDepthTestDistance: this._options.disableDepthTestDistance ?? 0,
heightReference:
this._viewer.scene.mode === Cesium.SceneMode.SCENE3D &&
!this._options.clampToModel
!this._options.clampToModel
? Cesium.HeightReference.CLAMP_TO_GROUND
: Cesium.HeightReference.NONE,
},

+ 3
- 1
src/modules/tools/EditTool.js 查看文件

@@ -134,7 +134,9 @@ class EditTool {
image: image,
width: this._options.icon_size[0],
height: this._options.icon_size[1],
eyeOffset: new Cesium.Cartesian3(0, 0, -100),
pixelOffset: this._options.pixelOffset || new Cesium.Cartesian2(0, 0),
eyeOffset: this._options.eyeOffset || new Cesium.Cartesian3(0, 0, -100),
disableDepthTestDistance: this._options.disableDepthTestDistance ?? 0,
heightReference:
this._viewer.scene.mode === Cesium.SceneMode.SCENE3D &&
!this._options.clampToModel

Loading…
取消
儲存