From f7143f7e029ef01b12bb642d73434cec407e4827 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 5 Oct 2009 22:36:51 +0000 Subject: [PATCH] Deal with dash arrays that come in with extra spaces at the end. r=ahocevar (closes #2271) git-svn-id: http://svn.openlayers.org/trunk/openlayers@9707 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Renderer/SVG.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/OpenLayers/Renderer/SVG.js b/lib/OpenLayers/Renderer/SVG.js index 14bc03f6b5..32ca4feafb 100644 --- a/lib/OpenLayers/Renderer/SVG.js +++ b/lib/OpenLayers/Renderer/SVG.js @@ -368,8 +368,8 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, { */ dashStyle: function(style, widthFactor) { var w = style.strokeWidth * widthFactor; - - switch (style.strokeDashstyle) { + var str = style.strokeDashstyle; + switch (str) { case 'solid': return 'none'; case 'dot': @@ -383,7 +383,7 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, { case 'longdashdot': return [8 * w, 4 * w, 1, 4 * w].join(); default: - return style.strokeDashstyle.replace(/ /g, ","); + return OpenLayers.String.trim(str).replace(/\s+/g, ","); } },