We use this widget a part of a tool kit that makes server requests based on the map selections. We expect you will want to use this widget as part of a client that will use the selection, but you can implement a listener in the class that has your OnModuleLoad and use this widget it to pan and zoom to the selection to mimic the behavior of other drag and zoom implementations available in the native JavaScript map.
This software was developed by Roland Schweitzer of Weathertop Consulting, LLC (http://www.weathertopconsulting.com/) as part of work performed for NOAA Contracts AB113R-04-RP-0068 and AB113R-09-CN-0182.
The NOAA licensing terms are explained below.
This software is provided by NOAA for full, free and open release. It is understood by the recipient/user that NOAA assumes no liability for any errors contained in the code. Although this software is released without conditions or restrictions in its use, it is expected that appropriate credit be given to its author and to the National Oceanic and Atmospheric Administration should the software be included by the recipient as an element in other product development.
import com.weathertopconsulting.olmapwidget.client.map.OLMapWidget;
public class MapExample implements EntryPoint {
OLMapWidget mapWidget = new OLMapWidget();
public void onModuleLoad() {
mapWidget.setDataExtent(-90, 90, -180, 180, 1);
mapWidget.setTool("xy");
RootPanel.get().add(mapWidget);
}
}