0
https://developers.google.com/maps/documentation/javascript/examples/directions-waypoints如何根据纬度和经度在谷歌地图上设置航点?
在这篇文章中,他们根据位置设置航点,但我想根据经度和纬度设置航点。有没有可能,如果是的话请引导。
https://developers.google.com/maps/documentation/javascript/examples/directions-waypoints如何根据纬度和经度在谷歌地图上设置航点?
在这篇文章中,他们根据位置设置航点,但我想根据经度和纬度设置航点。有没有可能,如果是的话请引导。
是的,这是可能的。您应该遵循Google Maps JavaScript API参考文档。
https://developers.google.com/maps/documentation/javascript/reference#DirectionsWaypoint
正如你所看到的位置属性可以是字符串或经纬度或放置对象。
所以,在你的代码,你可以写类似
waypts.push({
location: new google.maps.LatLng(myLat,myLng),
stopover: true
});