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)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6033 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-02-07 21:06:08 +00:00
parent 9d045baf71
commit 61f124f214
3 changed files with 91 additions and 10 deletions
+16 -10
View File
@@ -89,17 +89,23 @@ OpenLayers.Format.WMC.v1_1_0 = OpenLayers.Class(
);
// min/max scale denominator elements go before the 4th element in v1
var minSD = this.createElementNS(
this.namespaces.sld, "sld:MinScaleDenominator"
);
minSD.appendChild(this.createTextNode(layer.maxScale.toPrecision(10)));
node.insertBefore(minSD, node.childNodes[3]);
if(layer.options.resolutions || layer.options.scales ||
layer.options.minResolution || layer.options.maxScale) {
var minSD = this.createElementNS(
this.namespaces.sld, "sld:MinScaleDenominator"
);
minSD.appendChild(this.createTextNode(layer.maxScale.toPrecision(10)));
node.insertBefore(minSD, node.childNodes[3]);
}
var maxSD = this.createElementNS(
this.namespaces.sld, "sld:MaxScaleDenominator"
);
maxSD.appendChild(this.createTextNode(layer.minScale.toPrecision(10)));
node.insertBefore(maxSD, node.childNodes[4]);
if(layer.options.resolutions || layer.options.scales ||
layer.options.maxResolution || layer.options.minScale) {
var maxSD = this.createElementNS(
this.namespaces.sld, "sld:MaxScaleDenominator"
);
maxSD.appendChild(this.createTextNode(layer.minScale.toPrecision(10)));
node.insertBefore(maxSD, node.childNodes[4]);
}
return node;