Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm clustering the features on the layer using AnimatedCluster this way:

dataLayer = new OpenLayers.Layer.Vector("Data", {
         strategies: [
             new OpenLayers.Strategy.AnimatedCluster({
                 distance: 45,
                 animationMethod: OpenLayers.Easing.Expo.easeOut,
                 animationDuration: 60
                 })
             ],
         styleMap:  new OpenLayers.StyleMap(style)
     });

Then I'm adding features to this layer:

var feature = new OpenLayers.Feature.Vector(
                returnPoint(value.lng,value.lat),
                { description: "Description...."},
                );
feature.attributes = {"myId":"weather"};
...

It works all right, but I'd like to change the image when the feature is not clustered (so it is visible as one), depending on the myId attribute. I've created a filter (according to this example):

var filterLowestZoom = new OpenLayers.Filter.Comparison({

    type: OpenLayers.Filter.Comparison.EQUAL_TO,
    property: "count",
    value: 1

});

var filterWeather = new OpenLayers.Filter.Logical({filters: [filterLowestZoom,
    new OpenLayers.Filter.Comparison({
    type: "==",
    property: "myId",
    value: "weather"
})], type: OpenLayers.Filter.Logical.AND});

created the rule with this filter

var weatherRule = new OpenLayers.Rule({
filter: filterWeather,
symbolizer: {
    externalGraphic: "weather.png",
    graphicHeight: 22,
    graphicWidth: 22,
    fillOpacity:1.0
}

});

and then added the filter to map. It works when there's just filterLowestZoom set, but with the comparison to myId attribute id shows nothing. What's wrong?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.