How do you plan to update the gMap primefaces map centre?



  • As a software update of the map centre gMap Total primefaces? Is that possible from inside the bin?



  • index.xhtml:

    <h:form prependId="false">
    
    &lt;p:commandButton value="Обновить" actionListener="#{geocodeView.updateMapCenter}" update="geoGmap" /&gt;
    
    &lt;p:gmap id="geoGmap" widgetVar="geoMap" center="#{geocodeView.centerGeoMap}" zoom="2" type="ROADMAP" model="#{geocodeView.geoModel}"&gt;
    &lt;/p:gmap&gt;
    

    </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 ♪




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2