I want to know is it possible to show only specific region on map not the full world map using Map Kit.
Like if i want to show Asia map in my application then map kit hides remaining part of the map.
I want to know is it possible to show only specific region on map
Share
To handle the “map kit hides remaining part of the map” requirement, one thing you can do is create a black polygon overlay that covers the whole world with a cutout over Asia (or wherever you like).
For example, where you initialize the map (eg. in viewDidLoad):
and implement the
viewForOverlaydelegate method:This looks like this:
If you also want to restrict the user from scrolling beyond Asia or zooming too far out, then you’ll need to do that manually as well. One possible way is described in Restrict MKMapView scrolling. Replace
theOverlayin that answer withasiaOverlay.