[OpenLayers-Users] How to hide a feature from the map?

Paul Meems bontepaarden at gmail.com
Mon May 7 14:28:39 EDT 2012


Thanks Arnd,

After a lot of trial and error I've added a new rule specific when the
attributes equals 0
And added this style:
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">
                <ogc:Literal>#D73027</ogc:Literal>
              </CssParameter>
              <CssParameter name="fill-opacity">
                <ogc:Literal>0.001</ogc:Literal>
              </CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">
                <ogc:Literal>false</ogc:Literal>
              </CssParameter>
              <CssParameter
name="stroke-width"><ogc:Literal>0.001</ogc:Literal></CssParameter>
              <CssParameter name="stroke-opacity">
                <ogc:Literal>0.001</ogc:Literal>
              </CssParameter>
            </Stroke>
          </PolygonSymbolizer>

Just using 0 as opacity doesn't do anything and without the stroke-width a
line is drawn on IE7 (not on IE8, IE9 or FF).

Thanks,

Paul

--
Organizing the International Open Source GIS conference 2012 in The
Netherlands:
http://www.mapwindow.org/conference/2012/



2012/5/7 Arnd Wippermann <arnd.wippermann at web.de>

> **
> Have you tried
>
>         <Rule>
>           <Name>Default</Name>
>           <PolygonSymbolizer/>
>         </Rule>
> Perhaps it will work.
>
> Arnd
>
>
>  ------------------------------
> *Von:* openlayers-users-bounces at lists.osgeo.org [mailto:
> openlayers-users-bounces at lists.osgeo.org] *Im Auftrag von *Paul Meems
> *Gesendet:* Montag, 7. Mai 2012 11:34
> *An:* openlayers-users
> *Betreff:* [OpenLayers-Users] How to hide a feature from the map?
>
> I have a WFS layer that shows about 10 features.
> I have made a SLD for this layer.
> This SLD works fine when I define fill colors but when my attribute value
> is 0 I don't want to see the feature so I added this to my SLD:
>         <Rule>
>           <Name>Default</Name>
>           <PolygonSymbolizer>
>             <Fill>false</Fill>
>             <Stroke>false</Stroke>
>           </PolygonSymbolizer>
>         </Rule>
> This results in my undefined (=default style) feature to be drawn with a
> gray fill color and a black stroke.
>
> I can't filter this feature because the user can do some calculations
> which results in modified values of my attribute and thus in my coloring.
>
> How should I hide this feature?
>
> Thanks,
>
> Paul
>
> --
> Organizing the International Open Source GIS conference 2012 in The
> Netherlands:
> http://www.mapwindow.org/conference/2012/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120507/fcb53a5e/attachment.html


More information about the Users mailing list