Thank you Haze,. Now I know how to get the map, I want to get its center, I see the map has the methods getLatitude and get Longitude, but, although I move the center of the map, in my code the latiude and longitude have always the same values:
<m:map id="mapa" width="1350" height="250px" latitude="40.3574" longitude="-3.55138" enableScrollWheelZoom="true" binding="#{myBean2.map}">
<ui:repeat var="spot" value="#{myBean.spots}">
<m:marker latitude="#{spot.latitud}" longitude="#{spot.longitud}"/>
</ui:repeat>
</m:map>
<h:commandButton value="Do something" action="#{myBean2.doSomething}"></h:commandButton>
MyBean2.java:
private Map map;
(getter and setter)
.....
public String doSomething() {
latitud=Float.parseFloat(map.getLatitude());
longitud=Float.parseFloat(map.getLongitude());
.....
}
Why map.getLatitude() and map.getLongitude() always give the same value?