如果我的android设备离开该路径,它会通知或显示您没有遵循您的路径,是否有可能在google地图上遵循android (Programmatically)的路径?
我们将提供帮助,谢谢:)
发布于 2018-05-09 17:47:28
是的,有几种可能。例如,您可以从PolyUtil.isLocationOnPath(LatLng point, java.util.List polyline, boolean geodesic, double tolerance)中使用Google API实用程序库。在这种情况下,您需要(使用isLocationOnPath())检查用户位置是否位于路径的折线段上。就像这样:
if (!PolyUtil.isLocationOnPath(userLocationPoint, pathPolyline.getPoints(), true, 50)) {
// user away of pathPolyline more than 50 meters
// show your alert here
...
}
}其中50 -是公差(米)。NB!这不是一个完整的解决方案-只是一个方法。
此外,您还可以对多个路径点使用地质监测 (每个设备用户的限制为100 )。
https://stackoverflow.com/questions/50245601
复制相似问题