Skip to content

Commit

Permalink
fix: crash when hiding globe
Browse files Browse the repository at this point in the history
  • Loading branch information
claustres committed Jun 11, 2024
1 parent 1914029 commit 35ce268
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions map/client/mixins/globe/mixin.base-globe.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ export const baseGlobe = {
this.viewer = new Cesium.Viewer(domEl, viewerOptions)
const backgroundColor = _.get(viewerOptions, 'backgroundColor')
this.viewer.scene.backgroundColor = (backgroundColor ? createCesiumObject('Color', ...backgroundColor) : Cesium.Color.BLACK)
if (!_.get(viewerOptions, 'globe', true)) this.viewer.globe.show = false
// Debug mode ?
if (viewerOptions.debug) this.viewer.extend(Cesium.viewerCesiumInspectorMixin)
// Cesium always create a default provider
this.viewer.scene.imageryLayers.removeAll()
// Cesium always create a default provider when a globe is used
if (this.viewer.scene.imageryLayers) this.viewer.scene.imageryLayers.removeAll()
// Add defaults handler
this.registerCesiumHandler(this.getDefaultPickHandler, 'MOUSE_MOVE')
this.registerCesiumHandler(this.getDefaultPickHandler, 'LEFT_CLICK')
Expand Down Expand Up @@ -119,7 +118,7 @@ export const baseGlobe = {
Cesium.ScreenSpaceEventType[eventType])
},
unregisterCesiumHandler (eventType) {
this.cesiumHandlers.removeInputAction(Cesium.ScreenSpaceEventType[eventType])
this.cesiumHandler.removeInputAction(Cesium.ScreenSpaceEventType[eventType])
},
async createLayer (options) {
const processedOptions = this.processCesiumLayerOptions(options)
Expand Down

0 comments on commit 35ce268

Please sign in to comment.