强制MapKit仅以编程方式使用缓存的地图切片/禁用网络 [英] Force MapKit use cached map tiles only/disable network programmatically

查看:74
本文介绍了强制MapKit仅以编程方式使用缓存的地图切片/禁用网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们偶然发现了这样的问题。

We have stumbled upon such a problem.

我们正在开发一个旅行应用程序。为了确保用户在我们的应用程序中不花费漫游费用,我们决定实施设置选项,以便用户仅查看缓存地图。因此,我们让用户决定是否要从互联网加载地图,或者他想省钱并查看缓存的地图(存储在Library / Caches / MapTiles / MapTiles.sqlitedb中)。

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).

我们无法找到实现此目的的方法。有没有什么办法在这种情况下以编程方式禁用网络?或者强制MapKit只使用缓存切片?我们想通过编程改变APN来强制MapKit离线。是否有可能以编程方式更改APN?

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?

谢谢!

推荐答案

iPhone SDK应用程序无法访问网络适配器设置,并且我不知道MapKit API中的任何内容可让您控制其Internet使用情况。在这种情况下,您的最佳选择可能是提醒用户启用飞行模式或关闭数据漫游。

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.

这篇关于强制MapKit仅以编程方式使用缓存的地图切片/禁用网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆