I have style rules for features that enable the map to display the features based on its rule. For example, the map displays a feature from specific scale. I do this in this way

newRule = new OpenLayers.Rule({
    name: 'rulename',
    minScaleDenominator: 2000,
    maxScaleDenominator: 19000,
    filter: someFilter,
    symbolizer: someSymbolizer

Then add the rule to style and apply the style to features. This lets the map to display the feature from scale 2000 to 19000 and when the map goes out of the set scale then it does not display the features.

What I want to do here is, to apply those rules to FrameCloud Popups.

From what I've found so far, popups cannot have style rules. So I implemented this by registering event 'zoomend' and let it check whenever zoom level changes so that at certain zoom level the map loops through all the popups and hide / show them.

It works just enough but it seems unreliable and hardcoding.

I think there should be a better way to achieve this. Please advice me if you know the answer. Thanks in advance :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.