Android - GoogleMaps - 没有互联网连接的显示标记? [英] Android - GoogleMaps - display markers without internet connection?

查看:60
本文介绍了Android - GoogleMaps - 没有互联网连接的显示标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我的客户希望添加如下功能:
当用户有互联网连接地图时显示正常,但当用户启动应用程序离线(即使刚安装后),地图不会显示,但他仍然可以看到标记它的面积却有自定义背景吗?

我看到某种方式可以为背景添加叠加层,但是如果使用这种方式来显示标记?
我从来没有见过类似的东西,在搜索应用后,我不是100%确定是否有这样的可能。



感谢您的任何帮助。 需要连接到服务器以确认您的API密钥是否正确。在此之前,它不会显示任何数据(包括标记)。

第一次连接后,结果将被存储,并且不需要互联网来显示标记。地图数据不会明显加载(除非它被缓存),但会出现标记。



我认为这是一个错误,您无法显示标记(或其他可视对象如多段线)而不检查API密钥的正确性。只有当您想要加载Google地图切片时才强制执行此操作会更有意义。实际上,这是 gmaps-api-issues


lately my client wants to add functionality like that: when user have Internet connection maps are displayed normaly, but when user starts app offline(even just after instalation), maps arent shown but he can still see markers on its area however with custom background on it?

I see some way to add overlay for background but if theres a way to show markers? I have never met with something like that, and after searching app I'm not 100% sure is there anything like that possible.

Thanks for any help.

解决方案

Google Maps Android API v2 needs to connect to server to confirm your API key is correct. It won't display any data (including markers) before that.

After the first connection, the result is stored and you don't need internet to display markers. The map data won't load obviously (unless it is cached), but markers will appear.

I consider it a bug that you cannot display markers (or other visual objects like polylines) without checking API key correctness. It would make more sense to force that only when you want to load Google map tiles. It was actually requested on gmaps-api-issues.

这篇关于Android - GoogleMaps - 没有互联网连接的显示标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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