H
H
homer7412020-09-27 21:26:42
Yandex maps
homer741, 2020-09-27 21:26:42

How not to hide the label when clicking on the Yandex map?

hideIconOnBalloonOpen is an option that allows you to customize the hide of the label on click.
But she doesn't work. I put marks on the map through the ObjectManager, registered this option and nothing ... The balloon moved far from the mark to make sure that it does not close it.

ymaps.ready(function () {
    const myMap = new ymaps.Map('map', {
            // Задаем центр карты
            center: [59.928861, 30.355700],
            controls: [],
            // И масштаб
            zoom: 11
        }, {
            // searchControlProvider: 'yandex#search'
            hideIconOnBalloonOpen:false
        }),

        // Создаём макет содержимого.
        MyIconContentLayout = ymaps.templateLayoutFactory.createClass(
            '<div style="color: #FFFFFF; font-weight: bold;">$[properties.iconContent]</div>'
        );

    objectManager = new ymaps.ObjectManager({
        balloonCloseButton: false,
        hideIconOnBalloonOpen: false,
        gridSize: 32,
        clusterDisableClickZoom: true,
        balloonOffset: [ -50, -50 ]
        
    });

    objectManager.objects.options.set('preset', 'islands#greenDotIcon');
    objectManager.clusters.options.set('preset', 'islands#greenClusterIcons');
    myMap.geoObjects.add(objectManager);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
homer741, 2020-09-28
@homer741

Should be spelled like this

objectManager.objects.options.set('hideIconOnBalloonOpen', false);

And be sure to indicateballoonOffset

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question