我有一个开放的全景。我需要隐藏(或从标记中删除)关闭按钮。该按钮位于屏幕的右上角。你能帮我吗?
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:如果不可能,那么我想用图像替换本机按钮
答案 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