Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question