[OpenLayers-Users] Combine Filter and OpenLayers.Layer.WMS

Arnd Wippermann arnd.wippermann at web.de
Wed Oct 28 16:02:28 EDT 2009


Hi,

you can add it to the params of your WMS layer 

var params = {
    'layers' : 'OUTLINE,GRID30',
    'format' : 'image/png',
    'sld_body' : '<StyledLayerDescriptor version="1.0.0"
xmlns="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"><NamedLayer>
<Name>OUTLINE</Name><UserStyle><FeatureTypeStyle><Rule><PolygonSymbolizer><S
troke><CssParameter name="stroke">#888899</CssParameter><CssParameter
name="stroke-width">1.0</CssParameter></Stroke></PolygonSymbolizer></Rule></
FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>',
    'transparent' : true
}

or afterwards with

yourLayer.mergeNewParams({ SLD_BODY : '<StyledLayerDescriptor
version="1.0.0" xmlns="http://www.opengis.net/sld"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"><NamedLayer>
<Name>OUTLINE</Name><UserStyle><FeatureTypeStyle><Rule><PolygonSymbolizer><S
troke><CssParameter name="stroke">#888899</CssParameter><CssParameter
name="stroke-width">1.0</CssParameter></Stroke></PolygonSymbolizer></Rule></
FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>' });

Arnd 

-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von stash
Gesendet: Mittwoch, 28. Oktober 2009 20:11
An: users at openlayers.org
Betreff: Re: [OpenLayers-Users] Combine Filter and OpenLayers.Layer.WMS




Arnd Wippermann wrote:
> 
> Hi,
> 
> You can do this by SLD. You can build an SLD file for your case and 
> add it to the WMS request as SLD_BODY or SLD.
> 
> 

Hi,
thanks for your answer. Can you tell me an example of an sld_body (example
code). How do I integrate the filter code in SLD_BODY?

Thanks for your answer.

Best regards
stash

--
View this message in context:
http://n2.nabble.com/Combine-Filter-and-OpenLayers-Layer-WMS-tp3906401p39075
56.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list