How can I clear MKMapView's cache of map tiles?

后端 未结 3 1237
暖寄归人
暖寄归人 2020-12-18 02:01

I am working on an MKMapView based iPhone / iPad mapping app that overlays my own basic base map to provide for some limited functionality even when users are offline and ca

3条回答
  •  渐次进展
    2020-12-18 02:16

    I stumbled across this question, and it's certainly an interesting problem. Clearly, the MKMapView is saving the tiles to disk somewhere (because it survives a reboot). I wonder if a potential solution would be to 1) locate where cached tiles are being saved, and then 2) programatically delete that cache when your app starts. This would require a jailbroken device to give you file access outside your application sandbox. Obviously unsuitable for distribution, but for testing would presumably be acceptable.

    That said, when I had this problem I ended up just implementing my own tiled map view and running a reachability test to determine whether to display the google map or my offline mode.

提交回复
热议问题