Som*_*ddy 10 android google-maps
在我的android项目中,我有GeoPoints列表.我有一个算法来解码编码的折线字符串.任何人都可以帮助我将GeoPoints列表编码为折线字符串,以便将其保存在共享首选项中.
Chi*_*ara 15
你应该为Android添加新的googlemaps utils库,然后使用PolyUtil:
PolyUtil.encode(latLngPath)
PolyUtil.decode(encodedPath)
Run Code Online (Sandbox Code Playgroud)
对于 Java,官方Google Maps Services for Java库也有一个实用程序。
PolylineEncoding.decode(String);
PolylineEncoding.encode(List<LatLng>); // Note that this is not the Android LatLng
Run Code Online (Sandbox Code Playgroud)
代码在这里。
来自谷歌:
http://groups.google.com/group/google-maps-api/browse_thread/thread/c85319eb7fd930dc
看起来像 Java Polyline impl。进行中。
来自Github:
https://github.com/markrambow/JavaPolylineEncoder
https://github.com/petpen/JavaPolylineEncoder2
规格在这里:
https://developers.google.com/maps/documentation/utilities/polylinealgorithm
| 归档时间: |
|
| 查看次数: |
7987 次 |
| 最近记录: |