Git Product home page Git Product logo

Comments (6)

Abbe98 avatar Abbe98 commented on September 23, 2024

I would look at some GPX plugins and see if they support playback, then write some stuff to make sure that the marker always is located at/between the right coordinates.

What format is your GPS data in GPX? GeoJSON?
Is you using a (Live)API?

Edit:
Another solution would be to split the path. Location 1/2 loads first and at the end of the line the marker disappears. Then a new path between location 2/3 loads, at the end of the line the marker disappears and the location 3/4 loads and so on...

from leaflet.animatedmarker.

harish118 avatar harish118 commented on September 23, 2024

hi,

I am feeding GPS data (lat,lon) to the leaflet js. I was trying to get the marker to move as and when the co-ordinates change. I have a javascript timer which looks for updated gps co-ordinates and if there is a change in the older and current values, then it needs to move the marker to the new location / co-ordinates. "setLatLng" might be a way but perhaps it would have the smooth animation that animatedmarker has/does ".)

Cheers,
M&M

On Sunday, June 22, 2014 8:43 PM, Albin Larsson [email protected] wrote:

Add coordinates to the array with AJAX? I'm not 100 sure that it will work at all. I think that the marker will restart each time...
I would look at some GPX plugins and see if they support playback, then write some stuff to make sure that the marker always is located at/between the right coordinates.
What format is your GPS data in GPX? GeoJSON?
Is you using a (Live)API?

Reply to this email directly or view it on GitHub.

from leaflet.animatedmarker.

harish118 avatar harish118 commented on September 23, 2024

hi,

Thanks for the suggestion. I did think about adding the polyline in parts...like a-b,b-c,c-d then based on location use the start/stop method. Somehow it didn't seem elegant so I hesitated. I think I'll give that a try and see how it goes. ".)

from leaflet.animatedmarker.

harish118 avatar harish118 commented on September 23, 2024

It would have been just nice if the animated marker had some move, or moveTo method. So you can just start off with a certain co-ordinate...and then that changes you just call the animatedMarker.moveto(x,y) :-D

Cheers,
M&M

from leaflet.animatedmarker.

Abbe98 avatar Abbe98 commented on September 23, 2024

Leaflet supports adding points with AJAX(Bjørn Sandvik has been working with this solution).

What you could do is that when you adding a new point you drag a line from the last one to the new one. This would animate a line, but not a icon(that would work but look bad). This requires that you loads new coordinates very often...

from leaflet.animatedmarker.

harish118 avatar harish118 commented on September 23, 2024

Okie thanks Abbe for the pointer. I'll check it out

from leaflet.animatedmarker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.