I have been trying to update PolylineAnnotation with a new color but keep getting the below error.
[maps-android\AnnotationManagerImpl]: Can't update annotation: com.mapbox.maps.plugin.annotation.generated.PolylineAnnotation@774cedb, the annotation isn't an active annotation.
Is there a way to check if the PolylineAnnotation is active?
I am using Mapbox Offical Package (mapbox_maps_flutter)
Here is how I have tried updating the PolylineAnnotation. I have tried using the update method on PolylineAnnotationManager
final nearestLineAnnotation = PolylineAnnotation(
id: nearestLine.id,
lineColor: selectedRadioColor,
lineWidth: nearestLine.lineWidth,
geometry: nearestLine.geometry,
);
await _mapboxMapController.annotations
.createPolylineAnnotationManager()
.then(
(polylineAnnotationManager) {
polylineAnnotationManager.update(nearestLineAnnotation);
},
);
Please guide me if I am doing something wrong. Thank you :-)