I know that you are not looking for an external library, but check out the MapBox iOS SDK, which can do this. MapKit has unpredictable caching and offline behavior and there are no APIs exposed with which to manage those features.
iOS - Empty map tiles / Switch map to offline mode when on 3G/cellular
-
30-05-2022 - |
Question
I need my application to switch to offline mode even if 3G
is enabled.
I am using AFNetworking and it's quite easy to suppress all the HTTP
operations, but how do I handle the screens which have maps?
I don't want to do any data transfer, so I either need to cut off the internet access to the MapView
or replace
the tile request with empty offline tiles.
Is there any way to achieve this with MapKit and without using any external map library?
PS: I found a related-question here, but there was no clear answer and the topic is quite old (for example, CloudMade does not have API for iOS 6 yet)
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow