A
A
AAAA2015-10-25 01:13:24
Yandex
AAAA, 2015-10-25 01:13:24

Yandex Maps API. How to get directions on foot/bus/car?

Now I'm laying the route like this (below the code). But how to enable the user to create a route on foot / by car / public transport? I did not find such parameters in the Yandex Map API documentation.
var routeFrom = document.getElementById('route-from').value;
var routeTo = document.getElementById('route-to').value;
// Create a route
ymaps.route([routeFrom, [44.611021,33.546381]], {mapStateAutoApply:true}).then(
function(route) {
map.geoObjects.add(route);
// document.getElementById('route- length').innerHTML = 'Route length = ' + route.getHumanLength();
mapRoute = route;
},
function(error) {
alert('Unable to build route');
}
);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2015-10-25
@AlexanderWalker

There are no purely pedestrian routes, but routes with public transport are included using the routingMode parameter ( doc link ).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question