0

I have an opened panorama. I need to hide (or remove from markup) the close button. The button is located in the upper right corner of the screen. Could you please help me?

JSFIDDLE

js:

ymaps.ready(init);

var map,
    mapElem = document.getElementById('map'),
    panoramaElem = document.getElementById('panorama');

function init(){     
    map = new ymaps.Map("map", {
        center: [61.79,34.36],
        controls: [],
        zoom: 5
    });  

    ymaps.panorama.locate([61.79,34.36]).done(
        function (panoramas) {
            if (panoramas && panoramas.length > 0) {
                mapElem.style.display = 'none';
                panoramaElem.style.display = 'block';
                var panorama = new ymaps.panorama.Player(
                    'panorama', panoramas[0], { direction: 'auto' }
                );
            }
        }
    );    
};

PS: if this is not possible, then I would like to replace the native button with an image

rsjaffe
  • 5,600
  • 7
  • 27
  • 39
ptortyr45
  • 147
  • 1
  • 11

1 Answers1

1

You can use option controls:
var panorama = new ymaps.panorama.Player('panorama', panoramas[0], { direction: 'auto', controls: ['zoomControl'] });
Documentation: https://tech.yandex.com/maps/doc/jsapi/2.1/ref/reference/panorama.Player-docpage/#panorama.Player__param-options.controls

se0ga
  • 136
  • 2