[OpenLayers-Dev] Rule subclasses and 2.6

Andreas Hocevar andreas.hocevar at gmail.com
Thu Apr 3 04:21:39 EDT 2008


Tim-

On Thu, Apr 3, 2008 at 6:14 AM, Tim Schaub <tschaub at openplans.org> wrote:
>  The new style work includes the addition of OpenLayers.Rule and
>  subclasses.  The base Rule class corresponds well to the sld:Rule
>  element in the SLD spec (min/max limits constraints, symbolizers, etc.).
>
>  The subclasses of Rule (Comparison, FeatureId, and Logical) correspond
>  well to ogc:Filter elements in the Filter Encoding specification.
>  Though our Rule subclasses can have a symbolizer, an ogc:Filter knows
>  nothing of a symbolizer - in SLD, an ogc:Filter element is a child of an
>  sld:Rule that has a symbolizer.

To me, a logical step would be to have one Rule class, which has
minScale, maxScale, symbolizer, and a filter property. There would be
a new class OpenLayers.Filter with subclasses with the filter-related
code of the current Rule subclasses. I think that is in line with what
you think.

>  1) Do no mark Rule subclasses as part of the API.  Later, change them so
>  they are Filter subclasses and require that they be added to a Rule
>  (with a symbolizer) for things like styling.  They could also be used
>  alone (without rules) for things like WFS.  This would also require
>  changing the georss-flickr.html example (that uses Rule.Comparison) and
>  the wiki page on styling.

I am in favour of that option. We do not encourage people to touch
rules directly anyway (except for the georss-flickr example).

Also, the proposed change does not look like too much work to me.

>  2) Add Filter classes later and keep (the redundant) Rule subclasses
>  around until 3.0.

Nope.

Regards,
Andreas.



More information about the Dev mailing list