【发布时间】:2016-12-16 13:04:12
【问题描述】:
我之前将旅行模式设置为驾驶,它有可拖动的标记,我可以在其中更改方向或选择替代路线,当我确实更改为 TRANSIT 时,无法这样做。是否有任何限制或任何其他方式来实现这一点(travelMode: google.maps.TravelMode.TRANSIT)
function displayRoute(origin, destination, service, display) {
debugger;
service.route({
origin: { 'placeId': origin_place_id },
destination: { 'placeId': destination_place_id },
travelMode: google.maps.TravelMode.TRANSIT,
unitSystem: google.maps.UnitSystem.IMPERIAL
//travelMode: TravelMode,
//transitOptions: TransitOptions,
//drivingOptions: DrivingOptions
///avoidTolls: true
}, function (response, status) {
if (status === google.maps.DirectionsStatus.OK) {
display.setDirections(response);
} else {
alert('Could not display directions due to: ' + status);
}
});
}
提前致谢!
【问题讨论】:
标签: javascript jquery google-maps maps