can i update the line in Real time by adding more latlng
is updating the line in Real time by adding more latlng possible ?
I think so (if I understand correct), as it's doing that all the time anyway. Just remember to call setState on the whole thing to update.
will that animate the line from the start ou just then new update?
ah maybe I'm misunderstanding then...it will probably depend on your settings, if its mid-animation and you add some points, I'm not quite sure what will happen. Try it :).
will try and see how it works
I have a feeling it will probably just animate the original line (it kind of uses originalPoints to then build an interpolated state builtPoints, which probably won't be updated), as it duration won't really make sense, when bits get added on. So I think it would only work "properly" on a fresh set of data each time. Apologies if I confused you with that earlier as I misunderstood what you were after...
It sounds a bit like you want some slightly delayed animation based on real time information ? Just trying to think if there's a way around that, ie build the main line each time (non-animated as the time has passed), and just use the LineAnimator for each new delayed point, but it depends on the exact use case really.
Just to explain a bit clearer... Have 2 Polylines
PolyLineLayerOptions( polylines: [
alreadyCompletePolyline,
animatingPolyline //(which is the one LineAnimator updates)
])
As you get a new point, you create a new LineAnimator from the last point of alreadyCompletePolyline, to the new point, for a duration of 5 seconds for example. Once that animation is complete, add that last point to the alreadyCompletePolyline, and then create a new animatingPolyline from that point to the new one again. And so on...
@ibrierley thanks, I'm currently using flutter_map v3, i'll try it when this plugin gets updated