Eric,
I have the same problem as stated in 1st post above. I have read other
post and this problem seem to be persisted for sometime now as shown
is this earlier post
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/657ed9bb2e2e9011/794322db35f85adc?lnk=gst&q=Guillem#794322db35f85adc.
Rather than using timer hacks, I would have felt that this issue would
have been resolved by now. Anyway, I have tried several of the
techniques suggested in both post and to no avail. In the code below I
have placed 3 maps on a StackPanel. The map that is loaded on the 1st
sub-menu in the  stack panel is rendered properly but the other 2 sub-
menus in the stack panel has a 'grey area' for most of the map and the
map is not properly centered. The maps show up properly when I use a
Vertical Panel instead of a StackPanel. I don't want to use a Vertical
Panel I have placed the code below in an Ext-GWT widget. Could give me
some insights as to how fix this? I have already tried the
"checkResizeAndCenter()" function.

private void location()
        {
                //Function for "About Us -> Locations"

                StackPanel spLocationMap = new StackPanel();
                VerticalPanel vpLocationMap = new VerticalPanel();
                Label lblHeading = new Label("Map of Campus Locations");

                lblHeading.addStyleName("locationHeading");
                vpLocationMap.add(lblHeading);
                vpLocationMap.setSize("100%", "100%");
                spLocationMap.setSize("100%", "100%");

                spLocationMap.add(getMap(LatLng.newInstance(18.400754, 
-77.364009),
"Campus 1"), "Campus 1");
                spLocationMap.add(getMap(LatLng.newInstance(18.456352, 
-77.396647),
"Campus 2"), "Campus 2");
                spLocationMap.add(getMap(LatLng.newInstance(18.433755, 
-77.206820),
"Campus 3"), "Campus 3");

                spLocationMap.addStyleName("spLocationHeader");

                vpLocationMap.add(spLocationMap);
                vpLocationMap.addStyleName("verticalPanelLocation");

                center.removeAll();
        center.add(vpLocationMap);
                center.layout();
        }

        private MapWidget getMap(final LatLng point, final String campus)
        {
                Marker marker = new Marker(point);
                final MapWidget map = new MapWidget(point, 15);
                map.setSize("700", "488");
                map.setScrollWheelZoomEnabled(true);
                map.setDoubleClickZoom(true);
                map.addOverlay(marker);
                map.addControl(new SmallMapControl());
                map.addControl(new MapTypeControl());
                map.getInfoWindow().open(map.getCenter(), new InfoWindowContent
(campus));
                marker.addMarkerClickHandler(new MarkerClickHandler()
                {
                    @Override
                        public void onClick(MarkerClickEvent event)
                        {
                                InfoWindow info = map.getInfoWindow();
                        info.open(point, new InfoWindowContent(campus));
                        }
                });
                return map;
        }

Jones

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to