2
我正在使用directionsService通過google maps javascript api獲取路線。問題是,我想各個步驟,但讓他們成爲MVC對象的一部分,所以當你點擊他們,他們呈現在地圖上作爲默認Google Maps directions mvcobject獲取一個單獨的步驟
directionsDisplay.setDirections(response);
一樣。 一些代碼:
var directionsService = new google.maps.DirectionsService();
directionsDisplay.setMap(map);
var request = {
origin : a,
destination : b,
travelMode : google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
//Instead of setting directions to a panel i want to
//set just one to a panel and yet have it link to the
//map like the above does.
}});