瀏覽代碼

improve the roaming #65

tags/2.5.0
Caven Chen 4 年之前
父節點
當前提交
2bb0c45b88
共有 2 個文件被更改,包括 8 次插入6 次删除
  1. 7
    5
      modules/roaming/RoamingController.js
  2. 1
    1
      modules/roaming/RoamingPath.js

+ 7
- 5
modules/roaming/RoamingController.js 查看文件

@@ -3,6 +3,7 @@
* @Date: 2021-06-08 20:41:51
*/

import { Cesium } from '@dc-modules/namespace'
import { SceneEventType, PathEventType } from '@dc-modules/event'

class RoamingController {
@@ -23,11 +24,10 @@ class RoamingController {
return false
}
this._activedPath.pathEvent &&
this._activedPath.pathEvent.fire(
PathEventType.POST_RENDER,
this._viewer,
this._viewOption
)
this._activedPath.pathEvent.fire(PathEventType.POST_RENDER, {
viewer: this._viewer,
viewOption: this._viewOption
})
}

/**
@@ -123,6 +123,7 @@ class RoamingController {
this._activedPath && (this._activedPath.actived = false)
this._activedPath = undefined
this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this)
this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)
return this
}

@@ -135,6 +136,7 @@ class RoamingController {
this._activedPath && (this._activedPath.actived = false)
this._activedPath = undefined
this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this)
this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)
return this
}
}

+ 1
- 1
modules/roaming/RoamingPath.js 查看文件

@@ -101,7 +101,7 @@ class RoamingPath {
* @param viewOption
* @private
*/
_onPostRender(viewer, viewOption) {
_onPostRender({ viewer, viewOption }) {
if (!this.actived) {
return false
}

Loading…
取消
儲存