[OpenLayers-Users] Openlayers Layer.Switcher Problem with Classes ?!

P Kishor punk.kish at gmail.com
Fri Oct 2 09:25:46 EDT 2009


On Thu, Oct 1, 2009 at 12:35 PM,  <fLaNsch at gmx.de> wrote:
> Hi list,
>
> Im running Openlayers 2.8, an umn mapserver with a WMS-Mapfile including 1 Layer with many different classes. Like:
> CLASS
> EXPRESSION "fast_food"
>  STYLE
>  SYMBOL 'fastfood'
>    SIZE 6
>    MINSIZE 6
>    MAXSIZE 25
>  END
> END
> CLASS
> EXPRESSION "pub"
>  STYLE
>  SYMBOL 'pub'
>    SIZE 6
>    MINSIZE 6
>    MAXSIZE 25
>  END
> END
> ... so on
>
> Now, Im looking for an Openlayers function such as Layer.Switcher.Classes or something like that, to turn my WMS-Layer-Classes on/off. Because at the moment im only allowed to switch the hole WMS-Layer. So all 30 Layer-Classes are displayed at the same time with the result that the map is totally overloaded. If anyone knows how to handle, pls help me :).

OpenLayer's least count, the unit of map that it works with, is a
layer. OL doesn't care how many classes are in your layer. All it sees
is a layer at a time. If you want to control different classes turning
on or off, just separate them into different layers like so

LAYER fast_food
CLASS
EXPRESSION "fast_food"
 STYLE
 SYMBOL 'fastfood'
   SIZE 6
   MINSIZE 6
   MAXSIZE 25
 END
END

LAYER pub
CLASS
EXPRESSION "pub"
 STYLE
 SYMBOL 'pub'
   SIZE 6
   MINSIZE 6
   MAXSIZE 25
 END
END

and so on.

> Thanks!!
> Best regards, Simon
>





-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
Sent from Madison, WI, United States



More information about the Users mailing list