Answer the question
In order to leave comments, you need to log in
How to make a link follow after clicking on a label?
var myPlacemark = new ymaps.Placemark(
[56.315695, 44.017063], {
hintContent: 'Оперный театр'
}, {
hasBalloon: false,
href: 'Afgan.html'
}, {
iconImageHref: 'http://webmap-blog.ru/files/gmap/gicon/mm_20_red.png', //
iconImageSize: [12, 20],
iconImageOffset: [-6, -10]
});
marker.events.add('click', function (e) {
location = e.get('target')
.options.get('href');
});
myMap.geoObjects.add(marker);
myMap.geoObjects.add(myPlacemark);
Answer the question
In order to leave comments, you need to log in
If you formatted your code properly, you might notice that the icon settings are passed to the Placemark constructor as the fourth parameter, which is wrong. There must be a third.
And, well, still not enough iconLayout: 'default#image'
.
UPD. Taken from the comments:
can
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question