How do you plan to update the gMap primefaces map centre?
-
As a software update of the map centre
gMap
Totalprimefaces
? Is that possible from inside the bin?
-
index.xhtml:
<h:form prependId="false">
<p:commandButton value="Обновить" actionListener="#{geocodeView.updateMapCenter}" update="geoGmap" /> <p:gmap id="geoGmap" widgetVar="geoMap" center="#{geocodeView.centerGeoMap}" zoom="2" type="ROADMAP" model="#{geocodeView.geoModel}"> </p:gmap>
</h:form>
GeocodeView.java:
public class GeocodeView {
private MapModel geoModel; private String centerGeoMap = "41.850033, -87.6500523"; @PostConstruct public void init() { geoModel = new DefaultMapModel(); } public void updateMapCenter(ActionEvent ae) { centerGeoMap = "..."; // Меняете центр карты. } ...
}
A more complete example and documentation available http://www.primefaces.org/showcase/ui/data/gmap/geocode.xhtml ♪