<div dir="ltr"><div><div>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.<br><br></div>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.<br><br></div>Thoughts?<br><div><div><div><br>For example, this works in the Firebug console:<br><pre class="gmail-m_-6555128681964083129gmail-src gmail-m_-6555128681964083129gmail-src-javascript"><span style="color:rgb(160,32,240)"><span style="color:rgb(160,32,240)">var</span> <span style="color:rgb(160,82,45)">filter_layer_gm</span> = <span style="color:rgb(139,34,82)">'L117/all'</span>;<br>var</span> <span style="color:rgb(160,82,45)">filter_layer_ms</span> = <span style="color:rgb(139,34,82)">'road_sym'</span>;
<span style="color:rgb(160,32,240)">var</span> <span style="color:rgb(160,82,45)">filter_property</span> = <span style="color:rgb(139,34,82)">'CLASS'</span>;
<span style="color:rgb(160,32,240)">var</span> <span style="color:rgb(160,82,45)">filter_value</span> = <span style="color:rgb(139,34,82)">'Interstate'</span>;
<span style="color:rgb(160,32,240)"><br>var</span> <span style="color:rgb(160,82,45)"></span>sld = `<StyledLayerDescriptor version=<span style="color:rgb(139,34,82)">'1.0.0'</span>>
<NamedLayer>
<Name>${filter_layer_ms}</<wbr>Name>
<UserStyle>
<Title>Filter</Title>
<FeatureTypeStyle>
<Rule>
<span class="gmail-objectBox gmail-objectBox-text"><Filter><br></span><span class="gmail-objectBox gmail-objectBox-text"> <span class="gmail-objectBox gmail-objectBox-text"> </span><PropertyIsEqualTo matchCase="true"><br></span><span class="gmail-objectBox gmail-objectBox-text"> <span class="gmail-objectBox gmail-objectBox-text"> </span><PropertyName>${filter_property}</PropertyName><br></span><span class="gmail-objectBox gmail-objectBox-text"> <span class="gmail-objectBox gmail-objectBox-text"> </span><Literal>${filter_value}</Literal><br></span><span class="gmail-objectBox gmail-objectBox-text"> <span class="gmail-objectBox gmail-objectBox-text"> </span></PropertyIsEqualTo><br> </Filter></span>
<LineSymbolizer><br> <Stroke><br> <CssParameter name="stroke-width">100</CssParameter><br> <CssParameter name="stroke">#0000ff</CssParameter><br> </Stroke><br> </LineSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>`;
GeoMOOSE.<wbr>updateLayerParameters(filter_<wbr>layer_gm, {sld_body: sld});
GeoMOOSE.refreshLayers(filter_<wbr>layer_gm);</pre></div></div></div></div>