Hen*_*ric 7 android google-maps-android-api-2
I'm wondering if there are anyone out that have implemented Google Maps V2 and Baidu Maps in the same version; because GM doesn't work as intended in China?
Or should I split the project into two branches instead? However it would be nice to skip having two branches to maintain.
我的解决方案是照常实现 GM,但是如果用户设置了中国(通过设置)静态地图,则使用静态地图,但静态地图是从百度而不是谷歌获取的。
staticUrl = "http://api.map.baidu.com/staticimage?center="
+ location.getLongitude() + "," + location.getLatitude()
+ "&width=" + width + "&height=" + width + "&zoom=15"
+ "&markers=" + location.getLongitude() + "," + location.getLatitude();
Run Code Online (Sandbox Code Playgroud)
https://api.map.baidu.com/staticimage?center=121,31&width=300&height=300&zoom=15的结果:
如果尝试实现真实的地图解决方案,则不建议使用此方法。由于我有不同的位置仅由不同的国家/地区使用,因此可以使用此解决方案。
所以,这就是我解决它的方法。希望有人觉得这有帮助。
| 归档时间: |
|
| 查看次数: |
10621 次 |
| 最近记录: |