简体   繁体   中英

How to determine when mapview zoom level has changed using Mapbox-iOS-SDK?

I am using Mapbox-iOS-SDK 2.1.2 and I need to know when the user changes zoom level on the map view. I know how to get the current zoom level, but I don't see any delegate methods for determining when the zoom level actually changed.

My reason is I am trying to mimic the scale dependencies functionality found in ESRI, and I only want to display annotations for records in the local data store when the zoom level is 15+ .

Does anyone know if Mapbox supports notification when the zoom level has changed?

Or, does Mapbox support scale dependencies? If it does and I'm missing it, please let me know as that would save me from rolling my own version.

You can check if zoomLevel was changed in delegate method

  • (void)mapView:(MGLMapView *)mapView regionDidChangeAnimated:(BOOL)animated

https://www.mapbox.com/ios-sdk/api/Protocols/MGLMapViewDelegate.html#//api/name/mapView:regionDidChangeAnimated :

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM