Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question