[OpenLayers-Users] HELP!!! How implement Filter in WMS Layer

Paul james pauljame at gmail.com
Mon May 3 14:02:08 EDT 2010


Thanks Arnd!

So, I have 3 WMS layers: Roads, GasStation, Country...
The user will select the Layer with radiobutton, and after select one data
in Grid...

So I´ll use selectedWMSLayer.mergeNewParams with a SLD_BODY ...

Is that right?

And how about Mapfile configuration, Am I suppossed to change anything?
What?

Thanks


On Mon, May 3, 2010 at 1:58 PM, Arnd Wippermann <arnd.wippermann at web.de>wrote:

>  Hi Paul,
>
> SLD_BODY is a request parameter of a wms. If you can get from your grid a
> reference to your OpenLayers WMS layer, then you can use
>
> yourWMSlayer.mergeNewParams('SLD_BODY' : ....).
>
> if your wms have only one layer (in the eample below POLYGONS) to request,
> you can use something like this
>
> <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>COUNTRY</Name>
> <UserStyle>
> <FeatureTypeStyle>
> <Rule>
> <PolygonSymbolizer>
> <Fill>
> <CssParameter name="fill">#f0f0f0</CssParameter>
> <CssParameter name="fill-opacity">1.00</CssParameter>
> </Fill>
> <Stroke>
> <CssParameter name="stroke">#646464</CssParameter>
> </Stroke>
> </PolygonSymbolizer>
> </Rule>
> </FeatureTypeStyle>
> </UserStyle>
> </NamedLayer>
> </StyledLayerDescriptor>
>
> as SLD_BODY to highlight the the features of the layer. Attention! You have
> to delete the line feeds for the request.
>
> Zooming to the extent of the wms layer is not so easy, perhaps inpossible.
> You can request the WMS GetCapabilities and hope that there the correct
> extent are described for the layer. Or if the layer is also requestable as
> WFS you can perhaps on that way get the extent of the layer. But I'm not
> sure.
>
> If you are the holder of the WMS server, I would suggest, that you
> calculate the extent on other ways and adds it as array to your application.
>
> Arnd
>
>  ------------------------------
>  *Von:* Paul james [mailto:pauljame at gmail.com]
> *Gesendet:* Montag, 3. Mai 2010 16:39
> *An:* Arnd Wippermann
> *Cc:* fsalas; users at openlayers.org
>
> *Betreff:* Re: [OpenLayers-Users] HELP!!! How implement Filter in WMS
> Layer
>
>  Hi Arnd...
> I have some questions about that...
>
> First I have a geo app using Openlayers/Mapserver WMS with SDE layers....
> My application has a treeview with all layers, and a radiobox for each
> layer... When I click in a layer´s radiobox a window with a GRID containing
> all layer´s data is opened...
> In that GRID, When I select a line (layer´s data), the Map should :
>  1-) Highlight it
>  2-) Zoom in data selected
>
> Can I develope that using SLD and SLD_BODY ? Do you have any tip to how do
> that?
>
> Thanks
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100503/4c7ab82c/attachment.html


More information about the Users mailing list