如何沿谷歌地图路线定位兴趣点

问题描述

我正在使用 Flutter 构建我的地图应用程序,该应用程序需要显示地图路线上的特定点。

例如,用户沿途的加油站。

我正在使用 flutter_polyline_points 绘制路线

polylinePoints = polylinePoints();

  polylineResult result = await polylinePoints.getRouteBetweenCoordinates(
    GOOGLE_API_KEY,PointLatLng(start.latitude,start.longitude),PointLatLng(destination.latitude,destination.longitude),travelMode: TravelMode.driving,);


  if (result.points.isNotEmpty) {
    result.points.forEach((PointLatLng point) {
      polylineCoordinates.add(LatLng(point.latitude,point.longitude));
    });
  }

现在我有一个沿路径的坐标列表。 我还有各个地点的坐标列表,我想显示它们是否靠近用户正在走的这条路线。

我的问题是如何确定一个点靠近用户所走的路径?是否已经有可用的 API 函数来执行此操作?

谁能提供一些关于如何做到这一点的建议?

有计算公式吗? 我看过这个公式,但现在知道如何使用它了。

Algorithm to find Points of Interest along a route?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)