I have a case where I need to import an overlay map in top of MkMapView.
The overlay totally covers the google tiles below so there is no need loading, plus it adds overhead to the app.
Is there a way to tell mkMapView to stop loading tiles?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Actually there are 2 ways to implement the real “Hide Google tiles” method (johndope solution only puts an overlay on top of it but doesn’t prevent the tiles from loading).
Beware that option one described below might get your application rejected while option 2 will not but is a bit more complex.
Common Part: Retrieve the
MKMapTileViewobjectInside each
MKMapViewlies an undocumented class of type:MKMapTileView. Retrieving it is NOT a reason for rejection. In this code theMKMapViewinstance will be calledmapViewOption 1: Undocumented Method (!! can be a reason for rejection !! )
This will prevent the undocumented method
setDrawingEnabledto be called on theMKMapTileViewinstance.Option 2: Method Swizzling
Outside of your controller implementation you will write someting like:
And somewhere in your code (once your map view is loaded!) :
Hope this helps anyone, this code was originally described in this blog post.