pushMarker method
Future<void>
pushMarker(
- Marker marker
)
override
Implementation
@override
Future<void> pushMarker(Marker marker) async {
if (!_isActiveTrip) return;
// Animation Marker Manager Factory
tracker[marker.markerId] ??= IAnilocationTask.create(
description: AnilocationTaskDescription.animarker(
description: description,
begin: marker.toLatLngInfo,
end: marker.toLatLngInfo,
markerId: marker.markerId,
onAnimCompleted: _animationCompleted,
latLngListener: _locationListener,
curve: description.curve,
),
);
var task = tracker[marker.markerId]!;
///It makes markers to move at the first item to draw in map, until another location updates is received
if (task.description.isQueueEmpty &&
!task.isAnimating &&
task.isCompletedOrDismissed) {
_locationListener(marker.toLatLngInfo);
}
task.updateRadius(_radius);
task.updateActiveTrip(_isActiveTrip);
task.updateUseRotation(_useRotation);
await task.push(marker.toLatLngInfo);
}