File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 1.3.0
4
+
5
+ * Animate marker position changes instead of removing and re-adding
3
6
## 1.2.0
4
7
5
8
* Added a ` markerAnnotationWithHue() ` and ` pinAnnotationWithHue() ` method to allow custom marker/pin colors
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ extension AppleMapController: AnnotationDelegate {
94
94
let newAnnotation = FlutterAnnotation . init ( fromDictionary: annotationData, registrar: registrar)
95
95
if annotationToChange != newAnnotation {
96
96
if !annotationToChange. wasDragged {
97
- addAnnotation ( annotation: newAnnotation)
97
+ updateAnnotation ( annotation: newAnnotation)
98
98
} else {
99
99
annotationToChange. wasDragged = false
100
100
}
@@ -204,6 +204,16 @@ extension AppleMapController: AnnotationDelegate {
204
204
self . mapView. addAnnotation ( annotation)
205
205
}
206
206
207
+ private func updateAnnotation( annotation: FlutterAnnotation ) {
208
+ if self . annotationExists ( with: annotation. id) {
209
+ UIView . animate ( withDuration: 0.32 , animations: {
210
+ let oldAnnotation = self . getAnnotation ( with: annotation. id)
211
+ oldAnnotation? . coordinate = annotation. coordinate
212
+ oldAnnotation? . title = annotation. title
213
+ } )
214
+ }
215
+ }
216
+
207
217
private func getNextAnnotationZIndex( ) -> Double {
208
218
let mapViewAnnotations = self . mapView. getMapViewAnnotations ( )
209
219
if mapViewAnnotations. isEmpty {
Original file line number Diff line number Diff line change 1
1
name : apple_maps_flutter
2
2
description : This plugin uses the Flutter platform view to display an Apple Maps widget.
3
- version : 1.2 .0
3
+ version : 1.3 .0
4
4
homepage : https://luisthein.de
5
5
repository : https://github.com/LuisThein/apple_maps_flutter
6
6
issue_tracker : https://github.com/LuisThein/apple_maps_flutter/issues
You can’t perform that action at this time.
0 commit comments