Commits

Todor Todorov committed 01f588a

resizable map

Comments (0)

Files changed (1)

gwt-openlayers-client/src/main/java/org/gwtopenmaps/openlayers/client/MapWidget.java

 import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.RequiresResize;
 
 /**
  * See {@link Map}.
  * @author Edwin Commandeur
  *
  */
-public class MapWidget extends Widget {
+public class MapWidget extends Widget implements RequiresResize {
 
 	private Map map;
 	private MapOptions options;
 	protected void onLoad() {
 		// We update the size of the map to try to display the map correctly when the MapWidget's size is set with percentage
 		Scheduler.get().scheduleDeferred(new ScheduledCommand() {
-			
+
 			public void execute() {
-				getMap().updateSize();				
+				getMap().updateSize();
 			}
 		});
 	}
+
+	public void onResize() {
+		getMap().updateSize();
+	}
 }