private var scaleKvoToken:NSKeyValueObservation?
scaleKvoToken = agsMapView.observe(\.visibleArea) { mapViewThatChanged, _ in
print("Map Location changed to \(mapViewThatChanged.visibleArea?.extent.center.toCLLocationCoordinate2D())")
}
In the above code, I can get center location of the map continuously without any map scrolling so there is any possible reason to solve this problem...??
Solved! Go to Solution.
You can observe isNavigating and when that is set to false, get the new viewpoint. For example:
navigatingObserver = mapView.observe(\.isNavigating, options: [.new]) { (changedMapView, change) in
guard change.newValue == false else { return }
// e.g. read changedMapView.currentViewpoint(with: .centerAndScale)
}
You can observe isNavigating and when that is set to false, get the new viewpoint. For example:
navigatingObserver = mapView.observe(\.isNavigating, options: [.new]) { (changedMapView, change) in
guard change.newValue == false else { return }
// e.g. read changedMapView.currentViewpoint(with: .centerAndScale)
}