ソースを参照

improve the move event

4.x
cavencj 7ヶ月前
コミット
03dc051212
1個のファイルの変更22行の追加10行の削除
  1. 22
    10
      src/modules/event/type/MouseEvent.js

+ 22
- 10
src/modules/event/type/MouseEvent.js ファイルの表示



/** /**
* *
* Gets the mouse information for the mouse event
* @param position
* @private
*
* @param {*} position
* @returns
*/ */
_getMouseInfo(position) {
_getMousePosition(position) {
let scene = this._viewer.scene let scene = this._viewer.scene
let target = scene.pick(position)
let cartesian = undefined let cartesian = undefined
let surfaceCartesian = undefined let surfaceCartesian = undefined
let wgs84Position = undefined let wgs84Position = undefined
} }
} }
} }

return { return {
target: target,
windowPosition: position, windowPosition: position,
position: cartesian, position: cartesian,
wgs84Position: wgs84Position, wgs84Position: wgs84Position,
} }
} }


/**
*
* Gets the mouse information for the mouse event
* @param position
* @private
*
*/
_getMouseInfo(position) {
let scene = this._viewer.scene
return {
...this._getMousePosition(position),
target: scene.pick(position),
}
}

/** /**
* Gets the drill pick overlays for the mouse event * Gets the drill pick overlays for the mouse event
* @param position * @param position
? 'pointer' ? 'pointer'
: 'default' : 'default'
this._raiseEvent(MouseEventType.MOUSE_MOVE, mouseInfo) this._raiseEvent(MouseEventType.MOUSE_MOVE, mouseInfo)

// add event for overlay // add event for overlay
if (this._enableMouseOver) { if (this._enableMouseOver) {
if ( if (
} }
} }
} else { } else {
this._raiseEvent(MouseEventType.MOUSE_MOVE, { movement })
this._raiseEvent(
MouseEventType.MOUSE_MOVE,
this._getMousePosition(movement.endPosition)
)
} }
} }



読み込み中…
キャンセル
保存