Reputation: 6113
Using the google.maps.DirectionsService.route() and google.maps.DirectionsRenderer.setDirections() method, is it possible to change the text on the info window for the destination, without creating a custom parser for the journey?
I couldn't see anything in the API which allowed you to access the markers of the route.
I don't want any code, just yes/no, and a hint for the right direction to take.
Current Function:
var request = { origin: origPoint, destination: new google.maps.LatLng(dest.lat(), dest.lng()), travelMode: google.maps.DirectionsTravelMode.DRIVING, region: "GB" }; directionsService.route(request, function(result, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(result); } });
Thanks, Psy
Upvotes: 3
Views: 1509
Reputation: 23977
I'm afraid that the api doesn't offer a direct way to access the info windows or access the markers.
But there are several ways to achieve that parsing parts of the result data:
directionsDisplay.setDirections(result)
.I would prefer the second way since it's cleaner and you have more freedom in adjustments. The first way, it's only a hack and you are just changing the text.
Upvotes: 0