[OpenLayers-Dev] rules and filters. i'm confused

Eric Lemoine eric.c2c at gmail.com
Tue May 20 09:28:05 EDT 2008


On Tue, May 20, 2008 at 12:14 AM, Dejung Gewissler
<dejung.gewissler at oit.state.nj.us> wrote:
> Hi All,
>
> I've got the code snippet below working in 2.5 trunk. I think I remember
> seeing some email traffic about pushing Rules.Comparison to
> Filter.Comparison.... can't quite pin this one down.
>
> Anyway my upgraded apps don't seem to work now and the "Advanced
> Rule-based Styling" example in [1] seems just like what I've got below.
> Is there a better place to look? Any advice would be helpful.
>
> [1] http://trac.openlayers.org/wiki/Styles
>
>
> var GML_style = new OpenLayers.Style();
> var rulePopGreat = new OpenLayers.Rule.Comparison(
>        {
>            type: OpenLayers.Rule.Comparison.GREATER_THAN,
>            property: "POP2000",
>            value: "50000",
>            symbolizer: {
>                Polygon: {fillColor: "#FF0000", strokeColor: "gray"}
>            }
>        }
>    );
> GML_style.addRules([rulePopGreat]);
> var myGML = new OpenLayers.Layer.GML("GML Vectors",
> "GML_Municipality_Simplify.xml",
>        {visibility:false, maxResolution:5000, minResolution:1,
>            styleMap: new OpenLayers.StyleMap({
>                "default": GML_style})
>        }
>    );
>
>
> My error is ---> OpenLayers.Rule.Comparison has no properties

With 2.6 and trunk you should indeed OpenLayers.Filter.Comparison.

--
Eric



More information about the Dev mailing list