I've been searching high and low but I can't seem to find a solution to this particular issue. Is there a way to detect when the map enters or exits full screen mode? It's essentially like the DOM event onfullscreenchange.
I have a map with the "fullscreenControl" option set to true, and all I want is for the map to center on the markers when it goes into fullscreen mode, as well as display an infowindow only when the map is in fullscreen. How can I monitor changes in fullscreen mode?
I attempted using DOM events on the entire map, but that method doesn't appear to be effective, like so:
google.maps.event.addDomListener(document.getElementById("map-canvas"), "fullscreen", function () {
console.log("FULLSCREEN CHANGED");
});
Another idea I had was to create a Custom Control instead of the X button that triggers the fullscreenControl, which would toggle when the map goes full screen. Then, I could listen for a click event on that custom control. However, is there no simpler solution? Is there truly no onfullscreenchange event or similar functionality available?
Thank you for your assistance!