两个检查点是否落在两点之间的路线方向上?

时间:2018-06-23 15:26:35

标签: android google-maps google-places google-location-services

如果我有新的点(C),则这是两个点(A)和(B)之间的方向。如何检查点(C)是否落在(A)和(B)之间的方向

here

1 个答案:

答案 0 :(得分:1)

您可以使用Google Maps API中的Geometry库来确定点是位于线上还是附近。在此处查看示例:

https://developers.google.com/maps/documentation/javascript/geometry#isLocationOnEdge

对于Android:

https://github.com/googlemaps/android-maps-utils

isLocationOnEdge函数在此处实现:

https://github.com/googlemaps/android-maps-utils/blob/master/library/src/com/google/maps/android/PolyUtil.java

相关问题