|
|
|
|
|
|
|
|
this._tooltipMess = tooltipMess |
|
|
this._tooltipMess = tooltipMess |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_getEventPosition(e) { |
|
|
|
|
|
const { overlay, layer, position, surfacePosition } = e; |
|
|
|
|
|
if (!this._options.clampToModel) { |
|
|
|
|
|
return surfacePosition; |
|
|
|
|
|
} |
|
|
|
|
|
if (!overlay && !layer) { |
|
|
|
|
|
return surfacePosition; |
|
|
|
|
|
} |
|
|
|
|
|
return position; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* |
|
|
* |
|
|
* @param e |
|
|
* @param e |
|
|
|
|
|
|
|
|
* @private |
|
|
* @private |
|
|
*/ |
|
|
*/ |
|
|
_onClick(e) { |
|
|
_onClick(e) { |
|
|
let position = |
|
|
|
|
|
this._options.clampToModel && e.position ? e.position : e.surfacePosition |
|
|
|
|
|
|
|
|
let position = this._getEventPosition(e); |
|
|
if (!position) { |
|
|
if (!position) { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
*/ |
|
|
*/ |
|
|
_onMouseMove(e) { |
|
|
_onMouseMove(e) { |
|
|
this._viewer.tooltip.showAt(e.windowPosition, this._tooltipMess) |
|
|
this._viewer.tooltip.showAt(e.windowPosition, this._tooltipMess) |
|
|
let position = |
|
|
|
|
|
this._options.clampToModel && e.position ? e.position : e.surfacePosition |
|
|
|
|
|
|
|
|
let position = this._getEventPosition(e); |
|
|
if (!position) { |
|
|
if (!position) { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
* @private |
|
|
* @private |
|
|
*/ |
|
|
*/ |
|
|
_onRightClick(e) { |
|
|
_onRightClick(e) { |
|
|
this._plotEvent.fire( |
|
|
|
|
|
PlotEventType.DRAW_STOP, |
|
|
|
|
|
this._options.clampToModel && e.position ? e.position : e.surfacePosition |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
this._plotEvent.fire(PlotEventType.DRAW_STOP, this._getEventPosition(e)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
|
|
|
eyeOffset: new Cesium.Cartesian3(0, 0, -100), |
|
|
eyeOffset: new Cesium.Cartesian3(0, 0, -100), |
|
|
heightReference: |
|
|
heightReference: |
|
|
this._viewer.scene.mode === Cesium.SceneMode.SCENE3D && |
|
|
this._viewer.scene.mode === Cesium.SceneMode.SCENE3D && |
|
|
!this._options.clampToModel |
|
|
|
|
|
|
|
|
!this._options.clampToModel |
|
|
? Cesium.HeightReference.CLAMP_TO_GROUND |
|
|
? Cesium.HeightReference.CLAMP_TO_GROUND |
|
|
: Cesium.HeightReference.NONE, |
|
|
: Cesium.HeightReference.NONE, |
|
|
}, |
|
|
}, |