私は走行モードを「運転」に設定しています。ドラッグ可能なマーカーがあり、方向を変更したり、代替ルートを選択したりできます。そうする。任意の制限や、事前にこの(travelMode: google.maps.TravelMode.TRANSIT
)Google Mapsの旅行のトランジットモードはドラッグできません
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);
}
});
}
感謝を達成するための他の方法はあります!