Open cesar3030 opened 5 years ago
The line drawn ahead is because the userlocation gets updated in steps, but the UI is animated smoothly. So basicly you push the userlocation to the line array and the line gets rendered. But the currentposition of the user is animated slowly betweetn both the last and current user location. I'm facing the same issue, but when testing it on a real device its looking better than in the simulator.
Thanks for the info! I will soon be working on this again If I find a better way to do it, I'll ping you :)
Any updates on it? Not tried on a real device yet, but have the same visual effect while simulating location.
Hello there!
I’m tracking a user position and want to draw a line to see the path he walked.
How would you do that with this library?
I tried to implement it that way:
onUserLocationUpdate
from the MapboxGL.MapView component invokes the callback, it updates my container current position state (an array of coordinates [lng, lat]) which will cause the container to be re-rendered.I’m facing 3 issues with this implementation:
userTrackingMode={MapboxGL.UserTrackingModes.Follow}
of MapboxGL.MapView is not working (user's location does not stay on the center of the screen)Here is the element that renders the map and the line:
To test this component, I use the iOS Emulator with Debug > Location > City Run, enabled.
Thanks for your help!