これは機能しません:
directionsDisplay.setDirections(response.routes[1]);
これは機能します:
directionsDisplay.setDirections(response);
この理由を教えてください。
ルート インデックスを設定する必要があります。2 番目のルートを表示するには、次を使用します。
var route_num = 1;
var first_load = false;
directionsDisplay.setRouteIndex(route_num);
if (first_load) {
// only execute this when the directions are first displayed
directionsDisplay.setDirections(objRoutesResponse);
}