A
A
Alexander Karpov2016-09-09 10:14:51
JavaScript
Alexander Karpov, 2016-09-09 10:14:51

How to set up a route on the Yandex map?

The second point I pass the object {type: 'wayPoint', point:[54.980005, 83.145586]}
but then when you click on the balloon, only the coordinates will be displayed, and I would like custom text to be displayed.
I did not find it in the docks, please help, you can poke your finger.

ymaps.ready(function(){
    //Создадим карту;
    myMap = new ymaps.Map('myMap',{
        center: [54.975587, 83.033543],
        //        type: 'yandex#hybrid',
        zoom: 12
    });
    //Проложим маршрут
    ymaps.route([
        "Новосибирск, Речной вокзал",
        {type: 'wayPoint', point:[54.980005, 83.145586]}
    ], {
        mapStateAutoApply: true,
    }).then(function (route) {
     route.getPaths().options.set({
            // можно выставить настройки графики маршруту
            strokeColor: '2D5902',
            strokeWidth: '8',
            opacity: 1
        });
        myMap.geoObjects.add(route);
    });
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2016-09-09
@Inkognitoss

When you click on the pin?
Then everything is the same there as with the usual Placemark.
sandbox

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question