[Geoserver-users] Using LayerSwitcher() With a Layer Group of WMSs

Hello.

I am newbie to GeoServer and OpenLayers.

I am trying to setup a WMS that consists of 6 layers of thematic maps on GeoServer. I tried to add LayerSwitched() to the code but the map just went blank. My question is: is it possible to add LayerSwitched for a Layer Group of WMSs? If no, is there another way to show 6 layers of thematic maps (somehow at the same time) on GeoServer?

Thanks in advance.

//Ammar

Sounds like a question for the OpenLayers list.

Russ


On 10 Oct 2013, at 10:08, Ammar <ammar83_h@anonymised.com> wrote:

Hello.

I am newbie to GeoServer and OpenLayers.

I am trying to setup a WMS that consists of 6 layers of thematic maps on GeoServer. I tried to add LayerSwitched() to the code but the map just went blank. My question is: is it possible to add LayerSwitched for a Layer Group of WMSs? If no, is there another way to show 6 layers of thematic maps (somehow at the same time) on GeoServer?

Thanks in advance.

//Ammar


October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Ammar,

WMS is a great tool for showing layers altogether.

To pinpoint your issue it will be usefull to have the part of the code you are using to load the layers into the map and to display the layerswitcher.

Can you please provide a little snippet?

Thank you

···

Lorenzo Pini

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

On Thu, Oct 10, 2013 at 11:08 AM, Ammar <ammar83_h@anonymised.com> wrote:

Hello.

I am newbie to GeoServer and OpenLayers.

I am trying to setup a WMS that consists of 6 layers of thematic maps on GeoServer. I tried to add LayerSwitched() to the code but the map just went blank. My question is: is it possible to add LayerSwitched for a Layer Group of WMSs? If no, is there another way to show 6 layers of thematic maps (somehow at the same time) on GeoServer?

Thanks in advance.

//Ammar


October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi,

as Russ Hore also pointend, it’s an OpenLayers question, here’s why:

I see you are using the GeoServer “OpenLayers Preview” as a base to build your map.

I highly discourage that, because that page has the only required tools to preview the selected layer.

If you want to start learning OpenLayers I recommend you this tutorial:
http://docs.openlayers.org/library/introduction.html

It’s a step-by-step tutorial, very practical.

The reason your map becomes blank it’s because the OpenLayers library provided with the Preview page doesn’t include the LayerSwitcher control.

Trying to load that Control breaks the code execution, preventing the loading of the map.

As you can see in the source code, there is a comment to warn you about that.

I hope this helps. Regards
··· Lorenzo Pini == Our support, Your Success! Visit [http://opensdi.geo-solutions.it](http://opensdi.geo-solutions.it) for more information. == GeoSolutions S.A.S. Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 333 8128928 [http://www.geo-solutions.it](http://www.geo-solutions.it) [http://twitter.com/geosolutions_it](http://twitter.com/geosolutions_it) On Thu, Oct 10, 2013 at 12:18 PM, Ammar <[ammar83_h@anonymised.com](mailto:ammar83_h@anonymised.com)> wrote: > Thanks for your reply Lorenzo. This is part of the code, which I think is related to my problem: > > [omitted] > > Regards, > Ammar > > --- > > **From:** Lorenzo Pini <[lorenzo.pini@anonymised.com](mailto:lorenzo.pini@anonymised.com)> > **To:** Ammar <[ammar83_h@anonymised.com](mailto:ammar83_h@anonymised.com)> > **Cc:** "[geoserver-users@anonymised.comts.sourceforge.net](mailto:geoserver-users@lists.sourceforge.net)" <[geoserver-users@lists.sourceforge.net](mailto:geoserver-users@anonymised.comurceforge.net)> > **Sent:** Thursday, October 10, 2013 11:53 AM > **Subject:** Re: [Geoserver-users] Using LayerSwitcher() With a Layer Group of WMSs > > Hi Ammar, > > WMS is a great tool for showing layers altogether. > > To pinpoint your issue it will be usefull to have the part of the code you are using to load the layers into the map and to display the layerswitcher. > > Can you please provide a little snippet? > > Thank you > > Lorenzo Pini > > On Thu, Oct 10, 2013 at 11:08 AM, Ammar <[ammar83_h@anonymised.com](mailto:ammar83_h@anonymised.com)> wrote: > > > Hello. > > > > I am newbie to GeoServer and OpenLayers. > > > > I am trying to setup a WMS that consists of 6 layers of thematic maps on GeoServer. I tried to add LayerSwitched() to the code but the map just went blank. My question is: is it possible to add LayerSwitched for a Layer Group of WMSs? If no, is there another way to show 6 layers of thematic maps (somehow at the same time) on GeoServer? > > > > Thanks in advance. > > > > //Ammar > > > > ------------------------------------------------------------------------------ > > October Webinars: Code for Performance > > Free Intel webinars can help you accelerate application performance. > > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from > > the latest Intel processors and coprocessors. See abstracts and register > > > [http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk](http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk)