org.gwtopenmaps.openlayers.client.layer.WMSOptions Java Examples

The following examples show how to use org.gwtopenmaps.openlayers.client.layer.WMSOptions. 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: WmsLayerDef.java    From geowe-core with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Layer getLayer() {
	WMSParams wmsParams = new WMSParams();
	wmsParams.setFormat(format);
	wmsParams.setLayers(layerName);
	wmsParams.setTransparent(true);		
	
	WMSOptions wmsLayerParams = new WMSOptions();
	wmsLayerParams.setProjection(epsg);
	wmsLayerParams.setTransitionEffect(TransitionEffect.RESIZE);
	wmsLayerParams.setDisplayOutsideMaxExtent(true);			
	wmsLayerParams.setNumZoomLevels(GeoMapInitializer.MAX_NUM_ZOOM_LEVEL);
	wmsLayerParams.setIsBaseLayer(true);
	String attribution = getAttribution();
	if(attribution != null) {
		wmsLayerParams.setAttribution(attribution);
	}
	
	WMS wmsLayer = new WMS(getName(), url, wmsParams, wmsLayerParams);
	wmsLayer.setIsBaseLayer(false);

	return wmsLayer;	
}
 
Example #2
Source File: AppView.java    From geofence with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 */
private void addBaseLayer()
{

	GeofenceGlobalConfiguration geoFenceConfiguration = (GeofenceGlobalConfiguration) GeofenceUtils.getInstance().getGlobalConfiguration();
	
    /* base layer */
    WMSParams wmsParams = new WMSParams();
    wmsParams.setLayers(geoFenceConfiguration.getBaseLayerName());
    wmsParams.setFormat(geoFenceConfiguration.getBaseLayerFormat());
    wmsParams.setStyles(geoFenceConfiguration.getBaseLayerStyle());

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

    WMS layer = new WMS(geoFenceConfiguration.getBaseLayerTitle(),
    		geoFenceConfiguration.getBaseLayerURL(), wmsParams, wmsLayerParams);
    Dispatcher.forwardEvent(GeoGWTEvents.ADD_LAYER, layer);
}
 
Example #3
Source File: OpenLayersMapWrapper.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private WMS initializeWMSLayer(String url) {
    PropertiesManager properties = getPropertiesManager();
    defaultMapOptions.setProjection(DISPLAY_PROJECTION);
    currentMapProjection = DISPLAY_PROJECTION;

    String format = properties.getParameterAsString("wmsFormat");
    String styles = properties.getParameterAsString("wmsStyles");
    String layer = properties.getParameterAsString("wmsLayerName");
    String bgColor = properties.getParameterAsString("wmsBGColor");
    String isTransparent = properties.getParameterAsString("wmsIsTransparent");

    WMSParams wmsParameters = new WMSParams();
    wmsParameters.setFormat(format);
    wmsParameters.setLayers(layer);
    wmsParameters.setStyles(styles);
    wmsParameters.setIsTransparent(new Boolean(isTransparent));
    wmsParameters.getJSObject().setProperty("BGCOLOR", bgColor);

    WMSOptions wmsOptions = new WMSOptions();
    wmsOptions.setProjection(spatialReference);
    wmsOptions.setDisplayInLayerSwitcher(true);
    wmsOptions.setIsBaseLayer(true);
    return new WMS(layer, url, wmsParameters, wmsOptions);
}
 
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();
}