P
P
Pavel Gor2018-12-20 13:12:59
JavaScript
Pavel Gor, 2018-12-20 13:12:59

How to implement automatic determination of the optimal path on the map between points?

Hello. There was a problem with Yandex Map. I implement building a route between selected points

this.multiRoute = new window.ymaps.multiRouter.MultiRoute({
    // Описание опорных точек мультимаршрута.
    referencePoints: [
     [55.734876, 37.59308],
     "Санкт-Петербург, Владимирский пр",
     "Москва, ул. Мясницкая"
    ],
    // Параметры маршрутизации.
    params: {
      // Ограничение на максимальное количество маршрутов, возвращаемое маршрутизатором.
      results: 1
    }
  }, {
    // Автоматически устанавливать границы карты так, чтобы маршрут был виден целиком.
    boundsAutoApply: true
  });

But I can't find a solution to my problem. Between the points indicated by me. It is built that I am going first to St. Petersburg, then only to Moscow. Is it possible for Yandex Map to determine the optimal path itself? Thank you for your help :) All good and nice code :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rikonardo, 2018-12-20
@REKTOR_RG

I don’t know about Yandex, but Google has an API for creating different maps.
Read for it, maybe you have the opportunity to go to Google Maps: https://cloud.google.com/maps-platform/
If you prefer Yandex, take a look here:
https://tech.yandex.ru/maps/jsapi/
or here
https://tech.yandex.ru/maps/

R
Roman Shishkin, 2018-12-21
@roman901

Of course, there is no possibility, since there are entire services to simplify routes.
In one of the projects, we integrated with VeeRoute, for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question