【问题标题】:get course between two point in google maps在谷歌地图中获取两点之间的路线
【发布时间】:2017-05-12 12:38:42
【问题描述】:

我在 Google 地图

中有两点
pointA = -6.468151012664202, 106.77200317382812
pointB = -6.121438675500974, 106.47125244140625

如何使用 JavaScript 或 MySQL Query 获取课程/内容?

【问题讨论】:

标签: javascript mysql google-maps google-maps-api-3


【解决方案1】:

您需要使用 Google Maps API 的 geometry 库。在加载JS时,需要在JS脚本中添加libraries=geometry URL参数。

那么,你可以这样做:

var pointA = new google.maps.LatLng(-6.468151012664202, 106.77200317382812);
var pointB = new google.maps.LatLng(-6.121438675500974, 106.47125244140625);

var bearing = google.maps.geometry.spherical.computeHeading(pointA, pointB);

见: - https://developers.google.com/maps/documentation/javascript/geometry - https://developers.google.com/maps/documentation/javascript/reference#spherical

【讨论】:

  • nodejs(后端)怎么用?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-09-04
  • 1970-01-01
  • 2012-12-08
  • 2015-10-19
  • 1970-01-01
  • 2017-10-03
相关资源
最近更新 更多