|
From: Philipp V. <phi...@go...> - 2010-01-13 11:17:41
|
Got the answer myself...
had to set the base layer to true:
wmsLayerParams.setIsBaseLayer(true);
Cheers!
2010/1/13 Philipp Verhoeven <phi...@go...>
> Greetings,
>
> I'm trying to use an overview map with a different maplayer than shown in
> the map window. But I have problems integrating the overview map layer.
> Here is some code:
>
>
> // Set up the WMS which extends Layer
> WMSParams wmsParams = new WMSParams();
> wmsParams.setFormat("image/png");
> wmsParams.setIsTransparent(true);
> wmsParams.setLayers("basic");
> wmsParams.setStyles("default");
> wmsParams.setMaxExtent(new Bounds(90, 0, 120, 20));
>
> WMSOptions wmsLayerParams = new WMSOptions();
> wmsLayerParams.setIsBaseLayer(false);
> wmsLayerParams.setLayerOpacity(1.0);
>
> WMS wmsLayer = new WMS("basic", "
> http://labs.metacarta.com/wms/vmap0",
> wmsParams, wmsLayerParams);
>
> OverviewMapOptions options = new OverviewMapOptions();
> Layer[] layers = new Layer[1];
> layers[0] = (Layer)wmsLayer;
> options.setLayers(layers);
>
> map.getMap().addControl(new OverviewMap(options));
>
>
> Anyone knows whats wrong with the code?
>
> Cheers,
> Philipp
>
|