2

I am trying to change certain properties of a map and of things on a map when as the user zooms in or out certain distances. How can this be achieved? I have tried:

func mapView(_ mapView: MGLMapView, didChange mode: MGLUserTrackingMode, animated: Bool) {
    print(mode, "This is the mode")
    print(mapView.centerCoordinate, "This is the map view ")
}

But That did not seem to print anything inside the method when I moved around.

Raptor
  • 53,206
  • 45
  • 230
  • 366

1 Answers1

3

You can use the delegate method for this. mapView:regionDidChangeAnimated:

A complete list is mentioned here.

func mapViewRegionIsChanging(_ mapView: MGLMapView) {
    print(mapView.zoomLevel, " Cenetr -<<<<")
}
Shamas S
  • 7,507
  • 10
  • 46
  • 58