1

これは機能しません:

directionsDisplay.setDirections(response.routes[1]);

これは機能します:

directionsDisplay.setDirections(response);

この理由を教えてください。

4

1 に答える 1

0

ルート インデックスを設定する必要があります。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);
}
于 2013-07-16T16:02:02.967 に答える