OpenLayers OpenLayers

Changeset 6033

Show
Ignore:
Timestamp:
02/07/08 16:06:08 (1 year ago)
Author:
tschaub
Message:

Only write out min/max scale related properties if they are explicitly set on the layer. Thanks for slapping Safari around a bit with this on crschmidt. Works but still untested there. r=crschmidt (closes #1314)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Format/WMC/v1_1_0.js

    r5919 r6033  
    9090         
    9191        // min/max scale denominator elements go before the 4th element in v1 
    92         var minSD = this.createElementNS( 
    93             this.namespaces.sld, "sld:MinScaleDenominator" 
    94         ); 
    95         minSD.appendChild(this.createTextNode(layer.maxScale.toPrecision(10))); 
    96         node.insertBefore(minSD, node.childNodes[3]); 
     92        if(layer.options.resolutions || layer.options.scales || 
     93           layer.options.minResolution || layer.options.maxScale) { 
     94            var minSD = this.createElementNS( 
     95                this.namespaces.sld, "sld:MinScaleDenominator" 
     96            ); 
     97            minSD.appendChild(this.createTextNode(layer.maxScale.toPrecision(10))); 
     98            node.insertBefore(minSD, node.childNodes[3]); 
     99        } 
    97100         
    98         var maxSD = this.createElementNS( 
    99             this.namespaces.sld, "sld:MaxScaleDenominator" 
    100         ); 
    101         maxSD.appendChild(this.createTextNode(layer.minScale.toPrecision(10))); 
    102         node.insertBefore(maxSD, node.childNodes[4]); 
     101        if(layer.options.resolutions || layer.options.scales || 
     102           layer.options.maxResolution || layer.options.minScale) { 
     103            var maxSD = this.createElementNS( 
     104                this.namespaces.sld, "sld:MaxScaleDenominator" 
     105            ); 
     106            maxSD.appendChild(this.createTextNode(layer.minScale.toPrecision(10))); 
     107            node.insertBefore(maxSD, node.childNodes[4]); 
     108        } 
    103109         
    104110        return node; 
  • trunk/openlayers/tests/list-tests.html

    r5990 r6033  
    3232    <li>Format/test_WKT.html</li> 
    3333    <li>Format/test_WMC.html</li> 
     34    <li>Format/WMC/test_v1_1_0.html</li> 
    3435    <li>Format/test_XML.html</li> 
    3536    <li>test_Icon.html</li>