android - 如何检查标记是否在方向上?

标签 android google-maps

我正在使用 Google map 在 Android 中开发一个应用程序,我想检查标记是否在从 A 到 B 的方向?

enter image description here

最佳答案

您可以使用 Google Maps API Utility Library 中的 SphericalUtil.isLocationOnPath 方法那,根据the Javadoc :

Computes whether the given point lies on or near a polyline, within a specified tolerance in meters. The polyline is composed of great circle segments if geodesic is true, and of Rhumb segments otherwise. The polyline is not closed -- the closing segment between the first point and the last point is not included.

关于android - 如何检查标记是否在方向上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37652010/

相关文章:

javascript - 使用 Google Maps API V3 在标记上链接 <a> 叠加层

c# - 获取 ViewPager fragment 中的当前索引

android - 如何使用 DPAD 在 Android 5 上浏览操作菜单项

Android:当 EditText 是子级时如何使布局可点击

android - 跨平台游戏开发

google-maps - 谷歌地图在中国 "Are they actually blocked"?

android - Admob 是否支持 VAST 广告?

asp.net - 使用没有 API key 的谷歌地图?

android - 加载 Google map 时的 ProgressBar

android - 从多个纬度/经度获取多个地址