Colleagues, the question about the button fullscreen Control. I have this button does not work. What am I doing wrong? My goal is to display the map displayed in the iframe in full screen. Now nothing is happening.

<iframe src="http://127.0.0.1/yandex-map/" width="100%" height="500px" scrolling="no"></iframe> 

...

 var fullscreenControl = new ymaps.control.Button({ data: { iconType: 'expand', title: "Развернуть/свернуть карту" }, options: { selectOnClick: false, float: "right" } }); fullscreenControl.events.add("press" ,function (){ if (!fullscreenControl.isSelected()) myMap.container.enterFullscreen(); else myMap.container.exitFullscreen(); }); myMap.container.events.add("fullscreenenter" ,function() { fullscreenControl.data.set({iconType:"collapse"}); fullscreenControl.select(); console.log('fullscreenenter'); }); myMap.container.events.add("fullscreenexit" ,function() { fullscreenControl.data.set({iconType:"expand"}); fullscreenControl.deselect(); console.log('fullscreenexit'); }); myMap.controls.add(fullscreenControl); 

    1 answer 1

    The iframe tag describes the container within which an independent web page is displayed. The contents of the iframe cannot go beyond its boundaries; accordingly, the fullScreen button can act only within the size of the container and cannot expand the map onto the user's physical screen.

    PS we do not recommend using 127.0.0.1 and other ip addresses or fake domains, because there is a risk to get banned for exceeding requests from the site - in fact, together with your requests, all requests from services that use the same fake host will be counted.