M
M
mumus2017-09-30 16:15:41
JavaScript
mumus, 2017-09-30 16:15:41

Yandex maps and route with one point?

Good afternoon, I add a route like this:

function addRoute(startPoint, finishPoint){
        multiRoute = new ymaps.multiRouter.MultiRoute({
            // Описание опорных точек мультимаршрута.
            referencePoints: [
                startPoint,
                finishPoint
            ],
            // Параметры маршрутизации.
            params: {
                // Ограничение на максимальное количество маршрутов, возвращаемое маршрутизатором.
                results: 1
            }
        }, {
            // Автоматически устанавливать границы карты так, чтобы маршрут был виден целиком.
            boundsAutoApply: true
        });

        myMap.geoObjects.add(multiRoute);
    }

Several questions have arisen
  1. Tell me, please, what will the router return if there is only one address?
  2. When changing one of the addresses from the text field, is it better to delete the old route and rebuild a new one or edit an existing point?
  3. Is there any way to check if the route is built or not?
  4. Is there any way to check if the route has been added to the collection of geo objects on the map?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question