[Geomoose-users] Filtering WMS layers on the fly

James Klassen klassen.js at gmail.com
Fri Jan 13 12:36:58 PST 2017


Has anyone thought about or had any success defining and/or changing
filters for WMS layers in GeoMoose on the fly?  It looks like the basic
plumbing is in place behind the scenes.  What I am mostly wondering about
is how to best incorporate this into the user interface.  We will end up
with many layers where users will want to filter by various attributes and
each layer will obviously have different style that needs to be applied to
the filtered features.

I know this could be done either as a service or as an extension with
controls in its own tab but then we will end up with a service/extension
per layer and the action to add/edit/remove the filter is rather removed
from the layer it is controlling.  It would be nice to have the filtering
options next to the layer in the catalog or visible layers tabs.

Thoughts?

For example, this works in the Firebug console:

var filter_layer_gm = 'L117/all';
var filter_layer_ms = 'road_sym';var filter_property = 'CLASS';var
filter_value = 'Interstate';
var sld = `<StyledLayerDescriptor version='1.0.0'>
  <NamedLayer>
    <Name>${filter_layer_ms}</Name>
    <UserStyle>
      <Title>Filter</Title>
      <FeatureTypeStyle>
        <Rule>
          <Filter>
            <PropertyIsEqualTo matchCase="true">
              <PropertyName>${filter_property}</PropertyName>
              <Literal>${filter_value}</Literal>
            </PropertyIsEqualTo>
          </Filter>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke-width">100</CssParameter>
              <CssParameter name="stroke">#0000ff</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>`;

GeoMOOSE.updateLayerParameters(filter_layer_gm, {sld_body: sld});
GeoMOOSE.refreshLayers(filter_layer_gm);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20170113/c6846d22/attachment.html>


More information about the Geomoose-users mailing list