Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create custom legend for a layer where OpenLayers.Rule objects are created dynamically and added to a layer.

new OpenLayers.Rule({
                symbolizer: {
                    strokeColor : color,
                    fillColor: color
                filter: new OpenLayers.Filter.Comparison({
                    type: OpenLayers.Filter.Comparison.BETWEEN,
                    property: p,
                    lowerBoundary: from,
                    upperBoundary: to
            })); and so on ..

I need to extend functionality of legend where for each rule I need to extract how many vectors affected by the rule so that when user changes interval boundaries as above, drawn legend replaced by new numbers.

Is there any built-in functionality for this in OpenLayers ?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.