Skip to content
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

Data doesn't update when map moves #2100

Closed
3 tasks
SteveEdson opened this issue Jul 19, 2018 · 5 comments
Closed
3 tasks

Data doesn't update when map moves #2100

SteveEdson opened this issue Jul 19, 2018 · 5 comments

Comments

@SteveEdson
Copy link

SteveEdson commented Jul 19, 2018

Actual Result

Using map controls such as zoom, geolocation etc doesn't update the data when the map moves. When dragging the map after, it returns to its original position.

Expected Result

The data should re-render on each frame the map moves.

Reproduce Steps

https://codepen.io/SteveEdson/pen/OwRrKd <-- click the zoom button

To Do List

  • Add label and assign to milestone
  • Coding
  • Test
@SteveEdson
Copy link
Author

SteveEdson commented Jul 20, 2018

I figure this is because when dragging the 'map', it is actually dragging the data layer, which internally moves the map to match data, and the binding doesn't happen the other way round.

I've tried listening to the move event on the map, but I'm not sure what methods to call to get the data to redraw in the right place.

Some random things I've tried without success:

map.on('move', (e) => {
    myDeck.controller._controls.eventManager.moveInput.callback(e);
    myDeck.layerManager.setNeedsRedraw();
    myDeck.layerManager.setNeedsUpdate();
});

@Pessimistress
Copy link
Collaborator

@SteveEdson

A little bit of background: user interaction is actually handled by deck.gl instead of Mapbox. We do not subscribe to Mapbox's move event because the event is fired AFTER the map rerenders, and therefore the deck.gl canvas cannot be synced with the map. See this ongoing issue on mapbox-gl.

Because of this, we do not officially support using mapbox's controls to manipulate the viewport at the moment. This is rather unfortunate.

With that said, you can use this dirty hack:
https://codepen.io/Pessimistress/pen/BPpLZm

@SteveEdson
Copy link
Author

Thanks for the update, the 'hack' will do the job for the time being, much appreciated.

@SteveEdson
Copy link
Author

Has something changed in 6.0.1? target.moving seems to always be false for some reason after updating.

@vscchencc
Copy link

I have used the hack. the hack has no use .
deck.gl v6.3.3
mapbox v0.53.0

Do u have some any other method to solve the problem?

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

No branches or pull requests

3 participants