I achieved what I was looking for.  Here is what I did:

map.add(new HeaderContributor(new IHeaderContributor()
                {
                        private static final long serialVersionUID = 1L;

                        public void renderHead(IHeaderResponse response)
                        {
                                StringBuffer buf = new StringBuffer();
                                buf.append( "var bounds = new 
GLatLngBounds();\n");
                                buf.append( "var map = " + 
map.getJSinvoke("map" ) );
                                
                                for (CustomLocation custom : 
location.getCustomLocations()) {
                                        GLatLng point = new 
GLatLng(custom.getLatitude(), custom
                                                        .getLongitude());
                                        buf.append( "bounds.extend( " + 
point.getJSconstructor() + " );\n" );

                                }
                                buf.append( "map.setZoom( 
map.getBoundsZoomLevel(bounds) );\n"  );
                                
                                buf.append( "map.setCenter( bounds.getCenter() 
);\n");
                                
                                
response.renderOnDomReadyJavascript(buf.toString());
                        }
                }));


location is my data object that contains all my specific custom locations.

Works like a charm!
-- 
View this message in context: 
http://www.nabble.com/initial-GMap2-bounds-question-tp19883071p19886673.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to