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

Draw a route with a large number of data points, and the animation blinks #4930

Closed
jayantchens opened this issue Jul 3, 2017 · 6 comments
Closed

Comments

@jayantchens
Copy link

mapbox-gl-js version:v-0.38

1.I draw an animated route, a route or a marker flashes.
2.I set the animation through resquestAnimationFrame, each time loop 6 points and then push to an array and then set sourceData.

image

image

Expected Behavior:
I hope that the flashing situation in the graph does not appear, hoping to draw the route and the marker to synchronize, so that the marker stays at the last point of the route array

@kristfal
Copy link

kristfal commented Jul 3, 2017

As a workaround: Have you tried to put the point and linestring in a single feature collection and add it as a single source? You can then use style filters to render each feature type in the source differently.

@jayantchens
Copy link
Author

@kristfal Thanks for your reply, I try to combine point and lineString in a source, but I do not know how to render the last point of lineString to the point attribute

@mourner
Copy link
Member

mourner commented Jul 4, 2017

@JunYanchan you would need to create a FeatureCollection with two features — one with Point geometry and the other with LineString geometry. Then they would be a part of the same source and so guaranteed to be in sync. You would then create two different layers two style the features differently based on type.

The issue of markers out of sync with the map is tracked elsewhere — #2257

@mourner mourner closed this as completed Jul 4, 2017
@jayantchens
Copy link
Author

@mourner Thank you very much for your help, I have solved the problem of not being synchronized, but the occasional flashing pattern is still present.

@jayantchens
Copy link
Author

@mourner After testing, I found that there seems to be a conflict between the route rendering and the map background? Because I loaded the online map tiles, there was no route to render the flicker problem.

@anjinlu
Copy link

anjinlu commented Nov 14, 2017

Hi Jun Yan,

How did you resolve the issue?

Thanks.

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

4 participants