应用程序如何使用在Android 4+的谷歌离线地图? [英] How can apps use the Google Offline Maps from Android 4+?

查看:96
本文介绍了应用程序如何使用在Android 4+的谷歌离线地图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android有配版(4 +?)推出离线地图,我可以在手机上选择一个区域来缓存,然后谷歌地图的下载在手机上的数据映射。

随着我留言:我想使用的数据,这已经是我的设备上(如果用户已经做了离线地图下载使用前)。并没有开放给谷歌的服务器一个新的数据连接(例如,由于数据费将适用)。

我能否使用我的应用程序内的地图数据 - 例如,通过发送地图应用的意图确实显示的区域(也许覆盖)?
或者使用连地图工具我的应用程序里面?

我说的不是下载从谷歌服务器的一些瓦片到我的应用程序


解决方案

  

我能否使用我的应用程序内的地图数据 - 例如,通过发送地图应用的意图确实表现出一个区域(可能覆盖)?


好了,你可以通过调用地图应用 ACTION_VIEW 地理: 意图。至于这是否会查看一些缓存区域取决于用户使用什么样的地图应用程序和用户是否缓存在你指定的经度和纬度的区域。


  

或者使用连地图工具我的应用程序里面?


虽然你可以在你的应用程序集成图形页面,也不会使用该缓存数据。部分,这是因为图形页面 code predates任何这种缓存的东西。部分,这是因为缓存的数据被另一个进程(地图应用)所拥有,因此无法访问你。

Android has with version (4+ ?) introduced offline maps where I can on the handset select an area to cache and then Google Maps downloads that map data on the handset.

As I got a comment: I want to use the data, that is already on my device (if the user has done the downloading for offline maps use before). And not open a new data connection to Google's servers (e.g. because data charges would apply).

Can I use that map data from within my app - e.g. by sending the maps app an intent do show an area (perhaps with overlays)? Or use even the map widget inside my app?

I am not talking about downloading some tiles from the Google servers into my app

解决方案

Can I use that map data from within my app - e.g. by sending the maps app an intent do show an area (perhaps with overlays)?

Well, you can invoke a map application using ACTION_VIEW and a geo: Intent. Whether that will view some cached area depends on what map app the user uses and whether or not the user cached the area around your specified latitude and longitude.

Or use even the map widget inside my app?

While you can integrate a MapView in your app, it will not use this cached data. Partially, that is because the MapView code predates any of this caching stuff. Partially, that is because the cached data is owned by another process (the Maps app) and therefore is inaccessible to you.

这篇关于应用程序如何使用在Android 4+的谷歌离线地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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