Answer the question
In order to leave comments, you need to log in
How to determine that the yandex map could not build a route with the selected routingMode?
Good afternoon! I build routes in yandex maps indicating the type of route.
const multiRoute = new ymaps.multiRouter.MultiRoute({
referencePoints: [
userCoords,
...routesCoords
]
}, {
boundsAutoApply: true,
wayPointVisible: false,
routeActiveStrokeColor: '#E30611',
routeStrokeWidth: 2,
routeStrokeStyle: '1 2'
});
multiRoute.model.setParams({
routingMode: value // Одно из стандартных значений, которое может принимать карта
}, true);
multiRoute.model.events
.add('requestsuccess', () => {
map.geoObjects.add(multiRoute);
})
.add('requestfail', () => {
});
routingMode = 'auto'
always works, but the rest cannot build a route. requestfail
is not called at this point. Always works only requestsuccess
. requestsuccess
accept event
, but there I did not find any information that the route could not be built. Climbed to the dock, also did not find anything. Answer the question
In order to leave comments, you need to log in
I understood how, you need to do the following
https://yandex.ru/dev/maps/jsapi/doc/2.1/dg/concept...
Just get the active route on a successful request
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question