org.gwtopenmaps.openlayers.client.MapOptions Java Examples

The following examples show how to use org.gwtopenmaps.openlayers.client.MapOptions. 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: MapPreviewWidget.java    From geofence with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates the map option.
 *
 * @param isGoogle
 *            the is google
 */
private void createMapOption(boolean isGoogle)
{
    // TODO Auto-generated method stub

    OpenLayers.setProxyHost("gwtOpenLayersProxy?targetURL=");

    this.defaultMapOptions = new MapOptions();
    this.defaultMapOptions.setNumZoomLevels(18);
    if (isGoogle)
    {
        this.defaultMapOptions.setProjection("EPSG:900913");
        this.defaultMapOptions.setDisplayProjection(new Projection("EPSG:4326"));
        this.defaultMapOptions.setUnits(MapUnits.METERS);
        this.defaultMapOptions.setMaxExtent(new Bounds(-20037508, -20037508, 20037508,
                20037508.34));
        this.defaultMapOptions.setMaxResolution(new Double(156543.0339).floatValue());
    }
    else
    {
        this.defaultMapOptions.setProjection("EPSG:4326");
    }

    initMapWidget(this.defaultMapOptions, isGoogle);
}
 
Example #2
Source File: StationSelectorMap.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void addMapControls(MapOptions mapOptions) {
    super.addMapControls(mapOptions);
    MousePositionOptions options = new MousePositionOptions();
    options.setFormatOutput(new MousePositionOutput() {
        
        @Override
        public String format(LonLat lonLat, Map map) {
            lonLat.transform(getMapProjection(), EPSG_4326);
            StringBuilder sb = new StringBuilder();
            sb.append("Lon: ").append(lonLat.lon()).append(", ");
            sb.append("Lat: ").append(lonLat.lat());
            sb.append(" (").append(map.getProjection()).append(")");
            return sb.toString();
            
        }
    });
    map.addControl(new MousePosition(options));
}
 
Example #3
Source File: GeoMap.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
public void configure(final Projection displayProjection, final Integer numZoomLevels, final String units) {
	this.displayProjection = displayProjection; 		

	mapOptions = new MapOptions();
mapOptions.setDisplayProjection(this.displayProjection);
mapOptions.setNumZoomLevels(numZoomLevels);
mapOptions.setUnits(units);
mapOptions.setMaxExtent(getDefaultMapBound());
mapOptions.setMaxResolution(appClientProperties.getFloatValue("maxResolution"));
getMap().setOptions(mapOptions);
getMap().setMinMaxZoomLevel(0, 50);
}
 
Example #4
Source File: MapPreviewWidget.java    From geofence with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Inits the map widget.
 *
 * @param defaultMapOptions
 *            the default map options
 * @param isGoogle
 *            the is google
 */
private void initMapWidget(MapOptions defaultMapOptions, boolean isGoogle)
{
    mapWidget = new MapWidget("100%", "100%", defaultMapOptions);
    this.map = mapWidget.getMap();
    // this.map.addControl(new LayerSwitcher());
    if (isGoogle)
    {
        this.createOSM();
        // this.createBaseGoogleLayer();
    }
    else
    {
        WMSParams wmsParams = new WMSParams();
        wmsParams.setFormat("image/png");
        wmsParams.setLayers("basic");
        wmsParams.setStyles("");

        WMSOptions wmsLayerParams = new WMSOptions();
        wmsLayerParams.setTransitionEffect(TransitionEffect.RESIZE);

        layer = new WMS("Basic WMS", "http://labs.metacarta.com/wms/vmap0", wmsParams,
                wmsLayerParams);
        this.map.addLayer(layer);
    }

    this.initVectorLayer();
}
 
Example #5
Source File: OverviewMap.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void addMapControls(MapOptions mapOptions) {
   	// FIXME does not work .. navigation panel is still drawn
	mapOptions.removeDefaultControls();
	map.addControl(new ZoomIn());
	map.addControl(new ZoomOut());
}
 
Example #6
Source File: GeoMap.java    From geowe-core with GNU General Public License v3.0 4 votes vote down vote up
public GeoMap() {
	final MapOptions defaultMapOptions = new MapOptions();
	defaultMapOptions.removeDefaultControls();
	mapWidget = new MapWidget("100%", "100%", defaultMapOptions);		
	getMap().addControl(navHistory);
}
 
Example #7
Source File: GeoMap.java    From geowe-core with GNU General Public License v3.0 4 votes vote down vote up
public MapOptions getMapOptions() {
	return mapOptions;
}
 
Example #8
Source File: OpenLayersMapWrapper.java    From SensorWebClient with GNU General Public License v2.0 4 votes vote down vote up
public MapOptions getDefaultMapOptions() {
    return defaultMapOptions;
}
 
Example #9
Source File: OpenLayersMapWrapper.java    From SensorWebClient with GNU General Public License v2.0 4 votes vote down vote up
public void setDefaultMapOptions(MapOptions defaultMapOptions) {
    this.defaultMapOptions = defaultMapOptions;
}
 
Example #10
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());
}