我想知道是否有人在同一版本中实现了Google Maps V2和Baidu Maps?是因为通用汽车在中国没有达到预期的效果?

还是应该将项目分成两个分支?但是,最好跳过两个要维护的分支。

最佳答案

我的解决方案是照常实现GM,但是如果用户使用中国设置(通过设置)静态 map ,则该静态 map 是从百度而不是Google获取的。

staticUrl = "http://api.map.baidu.com/staticimage?center="
                + location.getLongitude() + "," + location.getLatitude()
                + "&width=" + width + "&height=" + width + "&zoom=15"
                + "&markers=" + location.getLongitude() + "," + location.getLatitude();

https://api.map.baidu.com/staticimage?center=121,31&width=300&height=300&zoom=15的结果:

如果尝试实现实际的 map 解决方案,则不建议使用此方法。
由于我有仅由不同国家/地区使用的不同位置,因此可以使用此解决方案。

所以,这就是我解决的方法。希望有人觉得这有帮助。

10-07 19:20
查看更多