[Geomoose-users] Filtering WMS layers on the fly

Eli Adam eadam at co.lincoln.or.us
Fri Jan 13 13:09:17 PST 2017


Hey Jim,

That's really cool!

I've done this with other things like OpenLayers and PostGIS with WMS,
especially for things like bufferred select (different color for the
one or several initial input polygons and the resultant buffered
selection).  In most cases, I've done it in a very non-flexible
predetermined way.

That's really cool that the underlying support is there in GeoMoose.
I'm not sure of the best way to propagate it to the user interface.
There are many different ways to style and symbolize and there could
be many ways to want to access that in the interface.

Best regards, Eli

On Fri, Jan 13, 2017 at 12:36 PM, James Klassen <klassen.js at gmail.com> wrote:
> 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);
>
>
> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geomoose-users


More information about the Geomoose-users mailing list