如何在全景模式下删除关闭按钮?

时间:2018-07-31 20:39:11

标签: yandex-api yandex-maps

我有一个开放的全景。我需要隐藏(或从标记中删除)关闭按钮。该按钮位于屏幕的右上角。你能帮我吗?

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:如果不可能,那么我想用图像替换本机按钮

1 个答案:

答案 0 :(得分:1)

您可以使用选项控件:
var panorama = new ymaps.panorama.Player('panorama', panoramas[0], { direction: 'auto', controls: ['zoomControl'] });
文档:https://tech.yandex.com/maps/doc/jsapi/2.1/ref/reference/panorama.Player-docpage/#panorama.Player__param-options.controls