Is it possible to cache iOS maps for use when the phone is offline?

拟墨画扇 提交于 2019-12-12 17:37:37

问题


Is it possible to request that an iOS app stores map images of a location so that they are available when the user is not connected to the internet?

i.e. if a user is in London, is it possible to force the app to source map images for Barcelona and keep them cached, so that once the user arrives in the location (without internet connectivity) the maps are already cached?

Thanks


回答1:


Unfortunately apple doesn't allow anybody to do that.The MapKit.framework is strictly for displaying them. However use CoreGraphics to take a "screenshot" of the certain area(i.e. the map) and save it as an image, then display that image later.




回答2:


It is impossible to do that with the native Maps app (Google Maps on iOS 5/ "Apple Maps" on iOS 6) that comes with iOS, since simply Apple restricts the usage of the MapKit.framework. However, you might want to try out other map solution, such as Bing Maps or OpenStreetMap. These alternatives also provide useful map data that you can consider using.




回答3:


If you want online/offline maps you should use something like Route-me.

It basically borrows the MapKit feature-set and API and provides a much broader range of options for mapping datasources.

Also, some notable branches have derived from that project, namely https://github.com/Alpstein/route-me, which provide even more features and better performance.



来源:https://stackoverflow.com/questions/12247918/is-it-possible-to-cache-ios-maps-for-use-when-the-phone-is-offline

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!