You could try putting the MapWidget inside and AbsolutePanel. FWIW: MapWidget's tend to dislike dynamic layout / rezising. Without knowing how the bindings are applied at runtime it *could* be affecting this.
For this reason you will find two methods: http://gwt-google-apis.googlecode.com/svn/javadoc/maps/1.0/com/google/gwt/maps/client/MapWidget.html#checkResize() http://gwt-google-apis.googlecode.com/svn/javadoc/maps/1.0/com/google/gwt/maps/client/MapWidget.html#checkResizeAndCenter() You might want to invoke these post init/load somehow. Even if you try it with a manual button to test if that fixes the problems your experiencing. Sorry to not be of more help. On Tue, Feb 23, 2010 at 5:37 PM, Lypheus <[email protected]> wrote: > Having some issues with Composite/UIBinder - the following will show > the map but it clips the image and things disappear when moved about > (see below). If I ditch uibinder then it renders and behaves as > expected. Am I missing anything here that would cause this behavior? > I'm thinking it could be in how I'm defining the MapWidget field, but > whatever is wrong is not obvious to me. > > import com.google.gwt.core.client.GWT; > import com.google.gwt.maps.client.InfoWindowContent; > import com.google.gwt.maps.client.MapWidget; > import com.google.gwt.maps.client.control.LargeMapControl; > import com.google.gwt.maps.client.geom.LatLng; > import com.google.gwt.maps.client.overlay.Marker; > import com.google.gwt.uibinder.client.UiBinder; > import com.google.gwt.uibinder.client.UiField; > import com.google.gwt.user.client.ui.Composite; > import com.google.gwt.user.client.ui.Widget; > > public class HelloWidgetWorld > extends Composite > { > interface MyUiBinder extends UiBinder<Widget, HelloWidgetWorld> { > } > private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class); > > @UiField > MapWidget map; > > public HelloWidgetWorld(String... names) > { > initWidget(uiBinder.createAndBindUi(this)); > setSize( "600px", "600px" ); > LatLng cawkerCity = LatLng.newInstance(39.509, -98.434); > map = new MapWidget(cawkerCity, 2); > map.setSize("600px", "600px"); > map.addControl(new LargeMapControl()); > map.addOverlay(new Marker(cawkerCity)); > map.getInfoWindow().open(map.getCenter(), new > InfoWindowContent("World's Largest Ball of Sisal Twine")); > } > } > > > <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' > xmlns:g='urn:import:com.google.gwt.user.client.ui' > xmlns:gm='urn:import:com.google.gwt.maps.client'> > <ui:style> > .bodyPanel { border: 4px solid black; } > .mapStyle { border: 2px dashed red; width: 100%; height: > 100%; } > </ui:style> > <g:HTMLPanel styleName="{style.bodyPanel}"> > <g:DockLayoutPanel styleName="{style.mapStyle}" unit='PX'> > <g:center> > <gm:MapWidget ui:field='map' /> > </g:center> > </g:DockLayoutPanel> > </g:HTMLPanel> > </ui:UiBinder> > > -- > 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]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- 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.
