R
R
rootya8022021-03-16 17:10:31
API
rootya802, 2021-03-16 17:10:31

Yandex Maps API. How can I change the text in the labels on the map?

I myself have never worked with the Yandex.maps API, so there was a small gag)
There is a script:

function init () {
    // Создаем карту
    var myMap = new ymaps.Map('map', {
        center: [55.75222, 37.61556],
        zoom: 7,
    });

    // Добавляем мультимаршруты
  ymaps.vow.all([
    ymaps.route(['Москва', 'Уфа']),
    ymaps.route(['Москва', 'Сочи']),
    ymaps.route(['Москва', 'Новосибирск'])
  ]).spread(function (route1, route2, route3) {
    myMap.geoObjects.add(route1).add(route2).add(route3);
    ymaps.geoQuery(route1.getPaths()).add(route2.getPaths()).add(route3.getPaths()).applyBoundsToMap(myMap);
  });
}

ymaps.ready(init);


Result
screen

6050bbd76bda3287336599.jpeg


How to change the numbers 1.2 on the labels to the names of cities? And is it even possible?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-03-16
@rootya802

https://yandex.ru/dev/maps/jsbox/2.0/router

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question