Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force MapKit use cached map tiles only/disable network programmatically

We have stumbled upon such a problem.

We are developing an application for travelling. To make sure the user doesn't spend much money on roaming charges in our app we decided to implement a settings option for user to view cached maps only. So we let the user decide whether he wants to load the maps from internet or he wants to save money and view cached maps (stored in Library/Caches/MapTiles/MapTiles.sqlitedb).

We can't find a way to implement this. Is there any way to disable network programmatically in this case? Or force MapKit use cached tiles only? We thought about changing APN programmatically for this option to force MapKit go offline. Is it possible to change APN programmatically?

Thank you!

like image 288
Slava TLM Avatar asked Dec 24 '09 18:12

Slava TLM


2 Answers

iPhone SDK apps do not have access to the network adapter settings, and I know of nothing in the MapKit API that gives you control over its Internet usage. Your best option in this case is probably to present an alert suggesting that the user enable Airplane Mode or turn off data roaming.

like image 125
Noah Witherspoon Avatar answered Nov 02 '22 19:11

Noah Witherspoon


use openstreetmap think the commercial side of it Cloud-made allows offline maps

http://developers.cloudmade.com/projects/show/iphone-sdk

Libraries that help iPhone developers use OSM maps route-me is an open-source library used in a number of iPhone applications to display OSM maps. The CloudMade iPhone Maps Library is an open-source library that provides high-level access to CloudMade's OSM-based map tiles with different sizes and different styles. John McKerrell has ported the routing algorithm from gosmore to run on the iPhone and has successfully generated basic routes. More complicated routes crash the iPhone at the moment

like image 20
brian.clear Avatar answered Nov 02 '22 20:11

brian.clear