Answer the question
In order to leave comments, you need to log in
How to make it so that when the description of the balloon is opened, the balloon itself does not disappear?
The label is hidden by default. How to make it so that when the description of the balloon is opened, the balloon itself does not disappear?
map
ymaps.ready(function () {
var myMap = new ymaps.Map('map', {
center: [55.751574, 37.573856],
zoom: 9
}, {
searchControlProvider: 'yandex#search'
}),
// Создаём макет содержимого.
MyIconContentLayout = ymaps.templateLayoutFactory.createClass(
'<div style="color: #FFFFFF; font-weight: bold;">$[properties.iconContent]</div>'
),
myPlacemark = new ymaps.Placemark(myMap.getCenter(), {
balloonContent: 'Описание' // сдесь содержимое балуна в формате html, все стили в css
}, {
// Опции.
// Необходимо указать данный тип макета.
iconLayout: 'default#image',
// Своё изображение иконки метки.
iconImageHref: 'https://habrastorage.org/webt/5b/74/1f/5b741fafe6be1831225435.png',
// Размеры метки.
iconImageSize: [35, 43],
// Смещение левого верхнего угла иконки относительно
// её "ножки" (точки привязки).
iconImageOffset: [-5, -38]
});
myMap.geoObjects.add(myPlacemark);
myPlacemark.balloon.open();
myMap.panes.get('ground').getElement().style.filter = 'grayscale(100%)';
});
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