Skip to content

Commit 2634230

Browse files
authored
Add missing properties to annotation update
Also update annotation image with update
1 parent dd5599c commit 2634230

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

ios/Classes/Annotations/AnnotationController.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,24 @@ extension AppleMapController: AnnotationDelegate {
206206

207207
private func updateAnnotation(annotation: FlutterAnnotation) {
208208
if self.annotationExists(with: annotation.id) {
209+
let oldAnnotation = self.getAnnotation(with: annotation.id)
210+
211+
209212
UIView.animate(withDuration: 0.32, animations: {
210-
let oldAnnotation = self.getAnnotation(with: annotation.id)
211213
oldAnnotation?.coordinate = annotation.coordinate
214+
oldAnnotation?.zIndex = annotation.zIndex
215+
oldAnnotation?.anchor = annotation.anchor
216+
oldAnnotation?.alpha = annotation.alpha
217+
oldAnnotation?.isVisible = annotation.isVisible
212218
oldAnnotation?.title = annotation.title
219+
oldAnnotation?.subtitle = annotation.subtitle
213220
})
221+
222+
// Update the annotation view with the new image
223+
if let view = self.mapView.view(for: oldAnnotation!) {
224+
let newAnnotationView = getAnnotationView(annotation: annotation)
225+
view.image = newAnnotationView.image
226+
}
214227
}
215228
}
216229

0 commit comments

Comments
 (0)