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
This commit is contained in:
@@ -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, ",");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user