Answer the question
In order to leave comments, you need to log in
How to call a large screen on a custom button in Yandex maps on click?
How to call a large screen on a custom button in Yandex maps on click?
My code looks like this:
ymaps.ready(init);
function init () {
var myMap = new ymaps.Map('map', {
center: [59.220501, 39.891523],
zoom: 12,
controls: ['fullscreenControl']
}, {
searchControlProvider: 'yandex#search'
})
var btnFullscreen = new ymaps.control.Button({
options: {
layout: ymaps.templateLayoutFactory.createClass(
"<div class='customZoomBtn'>fullscreen<div/>"
),
maxWidth: 150
}
});
myMap.controls.add(btnFullscreen, {
float: 'none',
position: {
bottom: '25px',
right: '25px'
}
});
btnFullscreen.events.add('click', function (event) {
myMap.enterFullscreen()
});
myMap.geoObjects.add(new ymaps.Placemark([59.220501, 39.891523], {
balloonContent: 'цвет <strong> какой то</strong>',
iconCaption: 'текст 2'
}, {
preset: 'islands#blueCircleDotIconWithCaption'
}));
}
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