Comments (4)
Thanks @nhinze. That's a really interesting idea. I'll try to carve out some time for it. I'm happy to help out with questions if you want to take a stab at it.
from leaflet.animatedmarker.
I added a little pull request that shows how I edited your code to send the distance travelled to a custom function at each interval. However, something cleaner would be nice. I'm not very familiar with leaflet yet.
from leaflet.animatedmarker.
Thank @nhinze. I glanced at it and I think there's probably a better way to tackle it. Your solution calls the callback at each vertex which could end up being less an ideal if you have a line that's 100 miles long but only a start and end point, for example. You'd only get callbacks on start and finish.
@mourner recommended that I check out the new DomPosition util to implement the animation. There might be something in there to help.
Again, thanks for the idea and the code ideas. Much appreciated!
from leaflet.animatedmarker.
Actually, the hack I did calls the function at minimum at each "interval". I have it set at 1000 ms, so I get a position/distance update at least every 1s. However, I do agree that my hack is a dirty solution and there is probably a better way.
from leaflet.animatedmarker.
Related Issues (20)
- package.json
- Markers position bug when map zooming
- how can add latlngs to the polyline in interval when it start run HOT 1
- Adding to Bower's registry HOT 2
- Using animated marker with realtime GPS data HOT 3
- Add git tag HOT 2
- when "zoom ing", the marker slides to the correct position instead of snapping to it HOT 2
- Any plans on adding to npm? HOT 4
- Using with react-leaflet HOT 3
- restart animation
- stop() does not work for me.
- onEnd gets called twice HOT 1
- demo not working under https HOT 2
- feature request: pause and continue HOT 1
- The demo doesn't work because gh-pages branch is not up-to-date
- infinite loop
- Project Status and recommended fork?
- demo ko HOT 1
- move the popup label (animated) together with marker.
- Fix the demo! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leaflet.animatedmarker.