-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updating viewState in v8.0.0 #4172
Comments
The v7 behavior was technically a bug (i.e. not consistent with the documentation). This breaking change is explained in the upgrade guide. As of 8.0, if you want to control the view state externally, you have to listen to I acknowledge that this is rather inconvenient, given that you only want to manipulate the view state sometimes. We are adding a feature in 8.1 that allows apps to update the |
const deckgl = new deck.DeckGL({
mapboxApiAccessToken: 'pk.eyJ1Ijoic3ltYm9saXgiLCJhIjoiY2prM2dqNWhiMTMwYzNrcnRmY2NnajI1cCJ9.g8-mLbubDPgqUv-CBx65Xg',
container: 'map',
initialViewState: {
longitude: 144,
latitude: -37,
zoom: 6
},
controller: true
})
deckgl.setProps({
initialViewState: {
longitude: -122,
latitude: 37,
zoom: 9,
transitionInterpolator: new deck.FlyToInterpolator()
}
}); |
Description
I'm updating my codes to use v8.* of the scripting API, and in particular I'm now setting the
InitialViewState
.However, since v8 I am no longer able to change the
viewState
dynamically. The map correctly changes location, but it becomes unresponsive to any drag or pan events.Reproducible example
jsfiddle here
Here is a contrived example, but it shows the issue I'm having
In this example I'm using v7.0.0 to show the desired beharviour. The map correctly loads to Melbourne, then changes to San Francisco, and the map is still responsive.
If you swap the
dist.min.js
for "https://unpkg.com/deck.gl@8.0.9/dist.min.js", it will correctly change location, but it won't be responsive.Given the updates to v8.*, how should I now change the location of the view?
The text was updated successfully, but these errors were encountered: