I have the following code to display googlemap using primefaces. This is not rendering the map. However if I set style="width:600px;height:400px" it is working fine. How do I get a full page view of the map in the browser?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<script src="http://maps.google.com/maps/api/js?sensor=false&v=3.4" type="text/javascript"></script>
</h:head>
<h:body>
<f:view contentType="text/html">
<h:form>
<p:gmap center="#{loadBean.centerLatitude},#{loadBean.centerLongitude}" style="width:100%;height:100%" zoom="3" type="HYBRID"/>
</h:form>
</f:view>
</h:body>
</html>
There are 2 ways:
1 Just set absolute position to map:
2 You can also set the width and height to all the parents of the map.
Add:
Modify your
<h:form>
: