Get the map from backing bean

52 views
Skip to first unread message

Jaime Fernandez de Gamboa Garcia

unread,
Dec 1, 2013, 1:26:54 PM12/1/13
to gmaps4...@googlegroups.com
Hi,

How can I get the map from the backing bean?

Thanks.

Hazem Saleh

unread,
Dec 2, 2013, 8:17:19 PM12/2/13
to gmaps4jsf-dev


--
You received this message because you are subscribed to the Google Groups "gmaps4jsf-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gmaps4jsf-de...@googlegroups.com.
To post to this group, send email to gmaps4...@googlegroups.com.
Visit this group at http://groups.google.com/group/gmaps4jsf-dev.
For more options, visit https://groups.google.com/groups/opt_out.



--
Hazem Saleh

Author of JavaScript Unit Testing book:
http://www.amazon.com/dp/1782160620/

Co-author of (The Definitive Guide to Apache MyFaces and Facelets) book:
http://www.amazon.com/-/e/B002M052KY

DeveloperWorks Contributing Author
https://www.ibm.com/developerworks/mydeveloperworks/blogs/hazem/entry/ibm_developerworks_contributing_author?lang=en_us

An Apache committer, IBMer, and a technical speaker

Twitter: http://www.twitter.com/hazems

Jaime Fernandez de Gamboa Garcia

unread,
Dec 8, 2013, 12:41:27 PM12/8/13
to gmaps4...@googlegroups.com, haz...@apache.org
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:

map.xhtml:

               <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?

Hazem Saleh

unread,
Dec 20, 2013, 9:08:16 AM12/20/13
to Jaime Fernandez de Gamboa Garcia, gmaps4jsf-dev
They should not. 

Which version of GMaps4JSF are you using?

Jaime Fernandez de Gamboa Garcia

unread,
Jan 2, 2014, 7:39:40 AM1/2/14
to gmaps4...@googlegroups.com, Jaime Fernandez de Gamboa Garcia, haz...@apache.org
I'm using gmaps4jsf-core-3.0.0.jar

Hazem Saleh

unread,
Jan 2, 2014, 9:23:46 AM1/2/14
to Jaime Fernandez de Gamboa Garcia, gmaps4jsf-dev
Please open a ticket and I will look into it.
Reply all
Reply to author
Forward
0 new messages