Skip to content

Conversation

@TheMrCam
Copy link
Contributor

Overview

Currently, even with baseLayer={false} and baseLayerPicker={false}, the <Viewer /> ends up creating a Bing Maps session. Can confirm by observing a request made to dev.virtualearth.net in the browser Network tab.

This PR resolves #707 by allowing baseLayer: false to pass into the Cesium.Viewer constructor.

Details

baseLayer: false has different behavior from baseLayer: undefined, so the existing code wasn't allowing for disabling the default Bing Maps baseLayer.

To fix the bug here, I removed the destructured baseLayer prop so it just gets passed in with ...props. I left the imageryLayers.removeAll() since it doesn't appear to be hurting anything.

Confirmed this change clears the dev.virtualearth.net request from the Network tab with <Viewer baseLayer={false} baseLayerPicker={false} />.

`baseLayer: false` has different behavior from `baseLayer: undefined`,
so the existing code wasn't allowing for disabling the Bing Maps
baseLayer.

Removed the destructured baseLayer prop so it just gets passed in with
`...props`. Left the check for baseLayer.removeAll() since it's not
hurting anything.

See https://cesium.com/learn/ion/optimizing-quotas/#optimizing-bing-maps-sessions
and https://cesium.com/learn/ion-sdk/ref-doc/Viewer.html#.ConstructorOptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot disable Bing Maps session

1 participant