Create two SLD in your geoserver, one with the textsymbolizer that renders
the labels for the given feature (SLD_LABEL.sld) and other without the
textsymbolizer (SLD_GEOM.sql) (or u could configure a pointsymbolizer,
linesymbolizer, etc whatever type of geometry ur feature is).

Then u just switch wms requests on ur demand on the client side:

-       When u wanna see labels the wms request must have
.&STYLES=sld_label.

-       When u don't wanna see labels but instead some symbol or line
representing or geometry, then the wms request must have .&STYLES=sld_geom.

This is quite easy to achieve when using a javascript client like
OpenLayers.

 

Hope this helps.

 

Cumprimentos,

Pedro M. Garcia Mendes 

 

De: Imran Rajjad [mailto:[email protected]] 
Enviada: quarta-feira, 14 de Outubro de 2009 12:01
Para: Arne Kepp
Cc: [email protected]
Assunto: Re: [Geoserver-devel] Switching Labels on/off through WMS?

 

An identical SLD without labels?.. can you kindly give an example of how
this parameter is used??

 

thnx a gazilion

 

Imran

On Wed, Oct 14, 2009 at 3:42 PM, Arne Kepp <[email protected]> wrote:

One option is to define a copy of the style on the server, without labels,
and refer to that style name using the mandatory STYLES parameter.

-Arne 



Imran Rajjad wrote:

Hello,
 Im using 1.7.4 .. I just wanted to know is there anyway that you can turn
the labels on and off through WMS request, since it is not possible for the
user to acess the SLD and change it himself, so I was wondering if I could
do that using wms request since the labels at time mess up the map too much,
but i havent found anything yet. Does anybody have an idea how do I do that?
 regards,
Imran

-- 
I.R






-- 
I.R

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to