org.gwtopenmaps.openlayers.client.control.Navigation Java Examples

The following examples show how to use org.gwtopenmaps.openlayers.client.control.Navigation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GeoMapInitializer.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
public void initialize() {

		geoMap.configure(GeoMap.INTERNAL_EPSG, MAX_NUM_ZOOM_LEVEL,
				DEFAUL_MAP_UNITS);

		final ScaleLineOptions slOptions = new ScaleLineOptions();
		slOptions.setTopOutUnits(DEFAUL_MAP_UNITS);
		slOptions.setBottomOutUnits("");

		final ScaleLine scaleLine = new ScaleLine(slOptions);
		scaleLine.getJSObject().setProperty("geodesic", true);
		geoMap.addControl(scaleLine);

		final Scale scale = new Scale();
		scale.getJSObject().setProperty("geodesic", true);
		geoMap.addControl(scale);

		geoMap.addControl(new Attribution());
		geoMap.addControl(new Navigation());
		geoMap.getMap()
				.getEvents()
				.register("mousemove", geoMap.getMap(),
						getMouseMoverEventHandler());
		geoMap.getMap()
				.getEvents()
				.register("click", geoMap.getMap(), getMouseClickEventHandler());

		geoMap.getMap()
				.getEvents()
				.register("touchstart", geoMap.getMap(),
						getMouseClickEventHandler());

		geoMap.getMap().addMapZoomListener(geoMapZoomListener);
	}
 
Example #2
Source File: OpenLayersMapWrapper.java    From SensorWebClient with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Override, if you want custom controls on the map. Per default the {@link Navigation} control is added
 * only.
 * 
 * @param mapOptions
 *        the map options where to set the map controls
 */
protected void addMapControls(MapOptions mapOptions) {
    mapOptions.removeDefaultControls();
    map.addControl(new Navigation());
}