I am unable to create custom polyline for transit directions on Google API. Only part of the route is rendered, not all. It works for driving, walking & cycling but not for
A polylineOptions anonymous object is not (and shouldn't be) a google.maps.Polyline.
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
var polyLineOptions = {
strokeColor: '#FF0000'
};
var options = {};
options.directions = response;
options.map = map;
options.polylineOptions = polyLineOptions;
//options.suppressMarkers = true;
directionsDisplay.setOptions(options);// = new google.maps.DirectionsRenderer(options);
polyLine.setMap(map);
//directionsDisplay.setDirections(response);
}
});
updated fiddle