OpenLayers OpenLayers

Changeset 5277

Show
Ignore:
Timestamp:
11/26/07 18:11:10 (1 year ago)
Author:
ahocevar
Message:

fixed propertyStyles caching

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/ahocevar/sldRenderer/lib/OpenLayers/Style.js

    r5253 r5277  
    174174        // walk through all rules to check for properties in their symbolizer 
    175175        var rules = this.rules; 
     176        var prefixes = OpenLayers.Style.SYMBOLIZER_PREFIXES; 
    176177        for (var i in rules) { 
    177             style = rules[i].symbolizer[symbolizerPrefix]; 
    178             for (var j in style) { 
    179                 if (typeof style[j] == "string" && 
    180                         style[j].match(/\$\{\w+\}/)) { 
    181                     propertyStyles[j] = true; 
     178            for (var s=0; s<prefixes.length; s++) { 
     179                style = rules[i].symbolizer[prefixes[s]]; 
     180                for (var j in style) { 
     181                    if (typeof style[j] == "string" && 
     182                            style[j].match(/\$\{\w+\}/)) { 
     183                        propertyStyles[j] = true; 
     184                    } 
    182185                } 
    183186            } 
    184187        } 
     188        return propertyStyles; 
    185189    }, 
    186190     
  • sandbox/ahocevar/styles/lib/OpenLayers/Style.js

    r5274 r5277  
    141141        } 
    142142 
    143         style.display = draw ? "" : "none"
     143        style.hidden = !draw
    144144 
    145145        // calculate literals for all styles in the propertyStyles cache 
     
    174174        // walk through all rules to check for properties in their symbolizer 
    175175        var rules = this.rules; 
     176        var prefixes = OpenLayers.Style.SYMBOLIZER_PREFIXES; 
    176177        for (var i in rules) { 
    177             style = rules[i].symbolizer[symbolizerPrefix]; 
    178             for (var j in style) { 
    179                 if (typeof style[j] == "string" && 
    180                         style[j].match(/\$\{\w+\}/)) { 
    181                     propertyStyles[j] = true; 
     178            for (var s=0; s<prefixes.length; s++) { 
     179                style = rules[i].symbolizer[prefixes[s]]; 
     180                for (var j in style) { 
     181                    if (typeof style[j] == "string" && 
     182                            style[j].match(/\$\{\w+\}/)) { 
     183                        propertyStyles[j] = true; 
     184                    } 
    182185                } 
    183186            } 
    184187        } 
     188        return propertyStyles; 
    185189    }, 
    186190