Answer the question
In order to leave comments, you need to log in
How to make a label a link to another page on Yandex.Maps?
I place a lot of markers on the map and each of the markers I set my own link. The task is to click on the label not to open the balloon, but to follow the given link. I'm trying to solve using a GeoObject with the following properties:
iconLayout: "default#imageWIthContent"
iconContentLayout: ymaps.templateLayoutFactory.createClass "<a style='display: block; width: 40px; height: 40px; background: #ccc' href='" + post.url + "'></a>"
Answer the question
In order to leave comments, you need to log in
You don't need to use a balun at all.
var marker = new ymaps.Placemark(
//координаты
{
...
},
{
hasBalloon: false,
href: 'http://google.ru/'
...
}
);
marker.events.add('click', function (e) {
location = e.get('target').options.get('href');
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question