使用Google Direction API查找路径的方向

阿达什·康恰迪

我正在使用Google Places API和Direction API标记2个地点之间的路线。我得到这条路线的折线。现在,我在这条路线上还有一条折线。

例如:A点到B点->初始折线C点到D点->第二条折线,它位于A-> B折线上。

使用isLocationOnEdge()方法,我能够找出C-> D折线是否位于A-> B折线上。

问题是我想找出路径C-> D是朝A-> B方向还是反向。有什么办法吗?

先生先生

使用几何库,您可以使用一种computeHeading方法。请参阅文档

因此,您可以计算点A和B之间的航向,并将其与点C到D的航向进行比较。

var heading = google.maps.geometry.spherical.computeHeading(path.getAt(0), path.getAt(1));

path您的第一条折线在哪里然后对第二个相同,并比较结果。

希望这可以帮助。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

使用算法A *查找路径

来自分类Dev

使用翻新版的Google Map Direction Api

来自分类Dev

使用翻新版的Google Map Direction Api

来自分类Dev

如何使用Google Direction API优化路线

来自分类Dev

Cypher:使用Scala AnormCypher查找路径?

来自分类Dev

结合使用Google Direction API和多个航点和模式

来自分类Dev

使用 Google Direction API for Mobile App 优化路线

来自分类Dev

iOS Google Maps Direction API提供了错误的扭曲路径

来自分类Dev

Android的Google Direction API是免费的吗?

来自分类Dev

Google Direction API 错误:REQUEST_DENIED

来自分类Dev

使用comgooglemaps的Google Map Direction

来自分类Dev

在JS中使用多维数组查找路径

来自分类Dev

在Python中递归使用Parents数组查找路径

来自分类Dev

使用Total Commander搜索在文件中查找路径

来自分类Dev

Google Direction API旅行时间与实时Google Map不同

来自分类Dev

Google Direction API错误:“请求无效。缺少'destination'参数。”

来自分类Dev

Google Direction API:不要将地址翻译成英文

来自分类Dev

Google Direction API返回的TrafficModel值不正确

来自分类Dev

Google Direction API错误:“请求无效。缺少'destination'参数。”

来自分类Dev

在Android上使用Google Maps Direction Service

来自分类Dev

我对使用 Direction API 获得的航点顺序感到困惑

来自分类Dev

如何在不使用Google Map Direction API的情况下在Android应用程序中查找2个地理位置之间的距离(按公路)?

来自分类Dev

谷歌地图使用哪种搜索算法查找路径,为什么?

来自分类Dev

如何使用vAxis.direction反转Google图形的顺序

来自分类Dev

Google Map Direction使用来自mysql的数据

来自分类Dev

Google Maps API V3-如何更改Direction Service的起点和终点

来自分类Dev

Google Maps API Direction Service 未显示超过 10 个标记

来自分类Dev

是否有必要在 google maps/direction api 中对 placeID 进行 url 编码?

来自分类Dev

查找路径中的最后一个单词,并使用bash使用正则表达式删除括号

Related 相关文章

  1. 1

    使用算法A *查找路径

  2. 2

    使用翻新版的Google Map Direction Api

  3. 3

    使用翻新版的Google Map Direction Api

  4. 4

    如何使用Google Direction API优化路线

  5. 5

    Cypher:使用Scala AnormCypher查找路径?

  6. 6

    结合使用Google Direction API和多个航点和模式

  7. 7

    使用 Google Direction API for Mobile App 优化路线

  8. 8

    iOS Google Maps Direction API提供了错误的扭曲路径

  9. 9

    Android的Google Direction API是免费的吗?

  10. 10

    Google Direction API 错误:REQUEST_DENIED

  11. 11

    使用comgooglemaps的Google Map Direction

  12. 12

    在JS中使用多维数组查找路径

  13. 13

    在Python中递归使用Parents数组查找路径

  14. 14

    使用Total Commander搜索在文件中查找路径

  15. 15

    Google Direction API旅行时间与实时Google Map不同

  16. 16

    Google Direction API错误:“请求无效。缺少'destination'参数。”

  17. 17

    Google Direction API:不要将地址翻译成英文

  18. 18

    Google Direction API返回的TrafficModel值不正确

  19. 19

    Google Direction API错误:“请求无效。缺少'destination'参数。”

  20. 20

    在Android上使用Google Maps Direction Service

  21. 21

    我对使用 Direction API 获得的航点顺序感到困惑

  22. 22

    如何在不使用Google Map Direction API的情况下在Android应用程序中查找2个地理位置之间的距离(按公路)?

  23. 23

    谷歌地图使用哪种搜索算法查找路径,为什么?

  24. 24

    如何使用vAxis.direction反转Google图形的顺序

  25. 25

    Google Map Direction使用来自mysql的数据

  26. 26

    Google Maps API V3-如何更改Direction Service的起点和终点

  27. 27

    Google Maps API Direction Service 未显示超过 10 个标记

  28. 28

    是否有必要在 google maps/direction api 中对 placeID 进行 url 编码?

  29. 29

    查找路径中的最后一个单词,并使用bash使用正则表达式删除括号

热门标签

归档