Skip to content

Commit 2414c34

Browse files
zuvolaLuisThein
authored andcommitted
fix: onCameraMove was not called by double-tap
1 parent 6b392d9 commit 2414c34

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ios/Classes/MapView/AppleMapController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ public class AppleMapController: NSObject, FlutterPlatformView {
283283
extension AppleMapController: MKMapViewDelegate {
284284
// onIdle
285285
public func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool) {
286+
if ((self.mapView.mapContainerView) != nil) {
287+
let locationOnMap = self.mapView.region.center
288+
self.channel.invokeMethod("camera#onMove", arguments: ["position": ["heading": self.mapView.actualHeading, "target": [locationOnMap.latitude, locationOnMap.longitude], "pitch": self.mapView.camera.pitch, "zoom": self.mapView.calculatedZoomLevel]])
289+
}
286290
self.channel.invokeMethod("camera#onIdle", arguments: "")
287291
}
288292

0 commit comments

Comments
 (0)