You can show responsive p: gmap full screen as follows:
Suppose it is p:gmap
defined as follows (no attribute needed style
)
<p:gmap id="gmap" center="41.381542, 2.122893" zoom="13" type="hybrid" />
JavaScript ,
<script>
function resizeElement(elementId,width,height){
console.log("Resizing element " + elementId + " W/H="+ width + "/" + height);
var element = document.getElementById(elementId);
element.style.width=width+"px";
element.style.height=height+"px"
}
function resizePfGmapFullScreen() {
var width = window.innerWidth - 20;
var height = window.innerHeight - 20;
resizeElement("gmap", width, height);
}
window.onload = function() {
window.dispatchEvent(new Event('resize'));
};
window.onresize = function(event) {
console.log("Screen is resized");
resizePfGmapFullScreen();
};
</script>
, p:map
, .
Primfaces 6.1.