What steps will reproduce the problem?
1. load map api and draw map widget
private void loadMapApi() {
boolean sensor = true;
ArrayList<LoadLibrary> loadLibraries = new ArrayList<LoadApi.LoadLibrary>();
loadLibraries.add(LoadLibrary.ADSENSE);
loadLibraries.add(LoadLibrary.DRAWING);
loadLibraries.add(LoadLibrary.GEOMETRY);
loadLibraries.add(LoadLibrary.PANORAMIO);
loadLibraries.add(LoadLibrary.PLACES);
Runnable onLoad = new Runnable() {
public void run() {
draw();
}
};
LoadApi.go(onLoad, loadLibraries, sensor);
}
}
private void draw(){
MapOptions op = MapOptions.newInstance();
MapWidget mw = new MapWidget(op);
mw.setSize("600px", "600px");
LatLng center = LatLng.newInstance(lat,longi);
VerticalPanel panel = new VerticalPanel();
op.setZoom(4);
op.setCenter(center);
op.setMapTypeId(MapTypeId.HYBRID);
panel.add(mw);
RootPanel.get().add(panel);
}
2. implement button, which will draw the map widget a second time
3. click on button (button click calls draw() method)
What is the expected output? What do you see instead?
expected: the newly added map should load and display normally
instead: I see the second map off center surrounded with grey background on one side. The first map still behaves normally
What version of the product are you using? On what operating system?
gwt 2.4
Please provide any additional information below.
similar issues:
https://code.google.com/p/gwt-google-apis/wiki/MapsFAQ#Why_do_I_see_the_map_off_center_surrounded_with_grey_background
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/3cc67a8e3b4b76a7/5b3c0b9f95875957?lnk=gst&q=layouts+maps#5b3c0b9f95875957