From 8521ebb7c0388c130635835f15fade2e6edf943d Mon Sep 17 00:00:00 2001 From: bartvde Date: Fri, 5 Feb 2010 18:13:24 +0000 Subject: [PATCH] Format.WMC: protect against MinScaleDenominator of 0, r=tschaub thanks tschaub for the updated patch, tests still pass in FF 3.5 and Safari 4 (closes #2028) git-svn-id: http://svn.openlayers.org/trunk/openlayers@10024 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/WMC/v1_1_0.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Format/WMC/v1_1_0.js b/lib/OpenLayers/Format/WMC/v1_1_0.js index e842403f43..40ca78980e 100644 --- a/lib/OpenLayers/Format/WMC/v1_1_0.js +++ b/lib/OpenLayers/Format/WMC/v1_1_0.js @@ -57,7 +57,10 @@ OpenLayers.Format.WMC.v1_1_0 = OpenLayers.Class( * node - {Element} An element node. */ read_sld_MinScaleDenominator: function(layerContext, node) { - layerContext.maxScale = this.getChildValue(node); + var minScaleDenominator = parseFloat(this.getChildValue(node)); + if (minScaleDenominator > 0) { + layerContext.maxScale = minScaleDenominator; + } }, /** @@ -69,7 +72,7 @@ OpenLayers.Format.WMC.v1_1_0 = OpenLayers.Class( * node - {Element} An element node. */ read_sld_MaxScaleDenominator: function(layerContext, node) { - layerContext.minScale = this.getChildValue(node); + layerContext.minScale = parseFloat(this.getChildValue(node)); }, /**