在我的android项目中,我有GeoPoints的列表。我有一个编码多段线字符串的algorithm to decode。有没有人可以帮我把GeoPoints的列表编码成折线字符串,以便将其保存在共享首选项中。
发布于 2013-08-16 22:01:35
您应该包含新的googlemaps utils library for Android,然后使用PolyUtil
PolyUtil.encode(latLngPath)
PolyUtil.decode(encodedPath)发布于 2016-02-17 08:00:18
对于Java来说,官方的Google Maps Services for Java库也有一个实用程序。
PolylineEncoding.decode(String);
PolylineEncoding.encode(List<LatLng>); // Note that this is not the Android LatLng代码是here。
发布于 2012-05-10 12:48:44
来自谷歌:
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
https://stackoverflow.com/questions/10379870
复制相似问题