Skip to content

deck.pickObject returns invalid info when using MVTLayer in MapboxLayer #5671

Answered by padawannn
fifzteen asked this question in Q&A
Discussion options

You must be logged in to vote

You need to update the deckGl viewstate whenever the map moves. Try adding a code like this to your example:

map.on('moveend', function() {
  const center = map.getCenter();
  const zoom = map.getZoom();

  deckGl.setProps({viewState:{
    longitude: center.lng,
    latitude: center.lat,
    zoom
  }});
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fifzteen
Comment options

Answer selected by fifzteen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants