Browse Source

improve the roaming #65

tags/2.5.0
Caven Chen 4 years ago
parent
commit
2bb0c45b88
2 changed files with 8 additions and 6 deletions
  1. 7
    5
      modules/roaming/RoamingController.js
  2. 1
    1
      modules/roaming/RoamingPath.js

+ 7
- 5
modules/roaming/RoamingController.js View File

* @Date: 2021-06-08 20:41:51 * @Date: 2021-06-08 20:41:51
*/ */


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


class RoamingController { class RoamingController {
return false return false
} }
this._activedPath.pathEvent && 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
})
} }


/** /**
this._activedPath && (this._activedPath.actived = false) this._activedPath && (this._activedPath.actived = false)
this._activedPath = undefined this._activedPath = undefined
this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this) this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this)
this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)
return this return this
} }


this._activedPath && (this._activedPath.actived = false) this._activedPath && (this._activedPath.actived = false)
this._activedPath = undefined this._activedPath = undefined
this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this) this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this)
this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)
return this return this
} }
} }

+ 1
- 1
modules/roaming/RoamingPath.js View File

* @param viewOption * @param viewOption
* @private * @private
*/ */
_onPostRender(viewer, viewOption) {
_onPostRender({ viewer, viewOption }) {
if (!this.actived) { if (!this.actived) {
return false return false
} }

Loading…
Cancel
Save