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

Using animated marker with realtime GPS data #40

Open
mm108 opened this issue May 1, 2016 · 3 comments
Open

Using animated marker with realtime GPS data #40

mm108 opened this issue May 1, 2016 · 3 comments

Comments

@mm108
Copy link

mm108 commented May 1, 2016

hi, thanks a lot for the fantastic plugin - looks cool. Had a small question as I am just getting started the leaflet - I have a situation where GPS data is received periodically by the server. How can I use your animated marker plugin to smoothly move the marker to the new gps location rather than just the current 'abrupt' jump method I am using. I guess I will have to do something like below?

var line = L.polyline([[Current Lat Lon],[New Lat lon]]),
    animatedMarker = L.animatedMarker(line.getLatLngs());

map.addLayer(animatedMarker);

Do I have to keep doing map.addLayer for every new gps position that I receiver?

Thanks,
M&M

@harithFED
Copy link

you find a way on this?

@atogle
Copy link
Member

atogle commented Mar 15, 2017

No, addLayer simply adds the layer to the map, not points to the line. You would need to add points to the polyline layer instead. I don't know if this would work automatically but seem like it would be possible.

@harithFED
Copy link

okay2. im using Ivan plugin xD

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