使用Android谷歌地图API V2作为离线瓷砖观众:这可能吗? [英] Using the android Google Maps API v2 as a viewer of offline tiles: is it possible?

查看:145
本文介绍了使用Android谷歌地图API V2作为离线瓷砖观众:这可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在谷歌地图组件(com.google.android.gms.maps.GoogleMap)允许一个呈现的自定义瓷砖(OpenStreetMap的或其他)。这些砖可以在设备和可脱机这是什么,我通过扩展TileProvider做。有这样做结合:

The Google map component (com.google.android.gms.maps.GoogleMap) allows one to render custom tiles (OpenStreetMap or other). These tiles can be on the device and available offline which is what I am doing by extending TileProvider. Doing this in conjunction with a:

mMap.setMapType(GoogleMap.MAP_TYPE_NONE);

我不拉从谷歌地图服务器的任何数据和组件可以合理预期没有连接到互联网的工作。 (我在这里强调的我不是缓存谷歌的数据。我正与脱机独立瓷砖谷歌的地图服务器)

I am not pulling any data from Google map servers and the component can reasonably be expected to work without an internet connection. (I emphasize here that I am not trying to cache Google's data; I am working with offline tiles independently of Google's map servers.)

我觉得一切都很好,直到我意识到,地图部件将无法工作,如果,当它首次执行,该设备处于脱机状态。在这种情况下,我得到一个消息:

I thought everything was fine until I realized that the map component won't work if, when it is executed for the first time, the device is offline. In such cases I get a message:

未能加载地图。无法联系谷歌的服务器

failed to load map. could not contact google servers

我想这背后的原因是需要我的应用程序,以验证该组件被允许执行谷歌的API密钥。

I imagine the reason behind this is Google's API keys which require my app to authenticate in order for the component to be allowed to execute.

任何人都可以证实这一点是正确的?我真的想肯定的是,只要该组件被执行一次联机,它会运行正常之后。我必须确保没有将要求该组件重新验证以后和这将基本上让我的应用程序没用的超时问题。这就需要在我移动到其他组件(如操作系统Android的)。

Can anyone confirm this is correct? What I would really like to be sure of is that provided that the component is executed once online, it will run ok afterwards. I must make sure that there are no time-out issues which would require the component to re-authenticate later on and which would basically make my app useless. That would require that I move on to some other component (such as OS Android).

在这个任何光线将大大AP preciated。甚至被指出,通过它我可以希望得到谷歌的开发人员的答复将是有益的渠道。

Any light on this would be greatly appreciated. Even being pointed to the channel through which I could hope to get a reply from the google developers would be useful.

感谢

推荐答案

由于对谷歌播放服务APK 3.0.27是固定的,所需的服务器只有一次联系。你会看到每次错误的logcat中,但它会奏效。

As of 3.0.27 of Google Play Services APK it is fixed and the server is required to be contacted just once. You will see error in the logcat every time, but it will work.

这里更多信息: HTTP://$c$c.google .COM / P / GMaps实现-API的问题/问题/详细信息?ID = 4817

在这里: HTTP://$c$c.google .COM / P / GMaps实现-API的问题/问题/详细信息?ID = 5017

这篇关于使用Android谷歌地图API V2作为离线瓷砖观众:这可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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