Answer the question
In order to leave comments, you need to log in
How to make a label with a caption and a hint on a Yandex map?
Hello!
It is necessary to display both a label and a hint on the Yandex.map. But for some reason, this code only gives one thing:
ymaps.ready(init);
function init() {
var myMap = new ymaps.Map('yandexMap', {
center: [59.9181, 30.3056],
zoom: 10
});
var myPlacemark = new ymaps.Placemark(
[59.8755, 30.3955],
{ hintContent: '<b>Адрес/метро:</b> Белы Куна 21-Н, 1й этаж/ м.Международная <br> <b>Площадь:</b> 45 м <br> <b>Стоимость:</b> 70 000 р. в мес. + К/У' },
{ iconContent: 'Магазин (нежилой фонд)' },
{ preset: 'islands#darkGreenStretchyIcon' }
);
myMap.geoObjects.add(myPlacemark);
};
Answer the question
In order to leave comments, you need to log in
You pass something too many parameters to the constructor, hintContent and iconContent should be in the same object:
const myPlacemark = new ymaps.Placemark([ 59.8755, 30.3955 ], {
hintContent: '<b>Адрес/метро:</b> Белы Куна 21-Н, 1й этаж/ м.Международная <br> <b>Площадь:</b> 45 м <br> <b>Стоимость:</b> 70 000 р. в мес. + К/У' ,
iconContent: 'Магазин (нежилой фонд)'
}, {
preset: 'islands#darkGreenStretchyIcon'
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question