我尝试了一些在谷歌地图上有点不正常的东西。我想要实现的是绘制一条具有多个航路点的路线,这些航路点有时可能是重复的。假设一个起点:A 和目的地:B,以及航路点 {1, 2, 3, 4, 5, 6, 7, 3, 2, 1} 从上面看,它总是会失败。如果我取出重复位置,它将显示路线。请帮忙。先谢谢了。
wayPoints.push(
{location:new google.maps.LatLng(stepsWP[0], stepsWP[1]),
stopover: false
}
...
var request = {
origin: start,
destination: end,
waypoints: wayPoints,
optimizeWaypoints: false,
travelMode: google.maps.TravelMode.DRIVING
};
var directionsRen = new google.maps.DirectionsRenderer(rendererOptions);
directionsRen.setMap(map);
directionsService.route(request, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsRen.setDirections(result);
}else{
console.debug('Something wrong with google...');
}
});