Max MKMapView Resolution/Zoom Level

The max resolution of iOS's MKMapView could only reach the Google zoom level 19, which seems to be insufficient especially for users who want to manually draw points of a path or shape with finger gesture directly on map. For example while drawing the edge of a house, those points would be too close for fingers to tap and drag.


We're using our own map layers which support zoom levels larger than 19, and the absence of system map layer for higer zoom levels is acceptable.


Is there any (hacked) way to increase the max resolution/zoom level of the MKMapView to level 20 or higher? or how to suggest Apple's map team to cancel this limitation in next iOS?

Replies

Zax, did you find any solution for this zooming issue? I am also looking for a solution.

Hello kkaverappa,

The starting point for a suggestion to Apple's map team to cancel this limitation would be to file a Radar. There is no way to tell when or if they will implement it. MapKit is designed for Apple's needs primarily. If you need something it doesn't provide, there are other mapping solutions available. Apple's solution is the only free one however.

One "hacked" way is to use private API:


mapView.setValue(21, forKeyPath: "_mapView._mapCameraController._mapModel._forcedMaxZoomLevel")


Tested on iOS 12.

Please don't do this. Calling into Apple's private APIs is unsupported and will break as the system changes over time.


If you'd like a map that can zoom further, please experiment with MKMapTypeSatelliteFlyover and MKMapTypeHybridFlyoverFlyover map types to see if those meet your needs, as they offer higher resolution imagery than the standard satellite and hybrid map types. If the Flyover maps don't meet your needs, please file Feedback items and explain your use case for zooming further beyond current limitations.

I've done some additional digging and discovered that you can draw tiles up to level 25 by creating a tile overlay with `canReplaceMapContent = true`. Of course in that case you will not get the base imagery from MapKit.


Using the flyover map types did not change anything for me; I get a maximum zoom level of 25 for .hybrid, .hybridFlyover, etc.


I work with drone imagery and it is pretty easy to create tiles at zoom levels higher than 25 (sub centimeter/px). Why not just allow MapKit to display content at arbitrary resolutions?

The trick to set _forcedMaxZoomLevel no longer works on iOS 14. You get an exception that it is not KVO compliant. The trick with overlay tiles and canReplaceMapContent = true do work, though.

I do not have a tilerenderer, I just need to zoom more for debugging purposes. So this is what I did: Initialization:

let overlay = MKTileOverlay(urlTemplate: "http://localhost/{z}/{x}/{y}")
overlay.canReplaceMapContent = true
overlay.maximumZ = 30
mapView.addOverlay(overlay, level: .aboveLabels)
_tileRenderer = MKTileOverlayRenderer(tileOverlay: overlay)

and then in the MKMapViewDelegate:

func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer

I do

return _tileRenderer

There is probably a more elegant way to make a NOOP tile overlay than pointing to localhost but for debugging this seem to work.

The maximum of 30 was just "big enough" to let med see differences on centimeter level.