Open julien-nc opened 8 years ago
This is actually difficult than it sounds. The snaking algorithm works with pixels, not map units, so calculating the length of the line and making sure everything works is hard. Specially since a user can zoom the map in and out while a line is snaking, so a change from "speed in px/sec" to "duration in seconds" will affect that.
It should be possible to change the this._map.latLngToContainerPoint()
to this._map.options.crs.project()
, and calculate map units, and calculate the speed in map units/second,
But, alas, this doesn't cover my use case and I must focus on core Leaflet right now. Feel free to send a PR if you can implement this without breaking the current behaviour.
Nice plugin !
It would be great to be able to set the total duration of the animation instead of the speed. This duration would be independent from the zoom level.
It is done like that in the "MovingMarker" plugin (https://github.com/ewoken/Leaflet.MovingMarker).
I would like to draw a polyline behind a moving marker.