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) {
|
dashStyle: function(style, widthFactor) {
|
||||||
var w = style.strokeWidth * widthFactor;
|
var w = style.strokeWidth * widthFactor;
|
||||||
|
var str = style.strokeDashstyle;
|
||||||
switch (style.strokeDashstyle) {
|
switch (str) {
|
||||||
case 'solid':
|
case 'solid':
|
||||||
return 'none';
|
return 'none';
|
||||||
case 'dot':
|
case 'dot':
|
||||||
@@ -383,7 +383,7 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
|||||||
case 'longdashdot':
|
case 'longdashdot':
|
||||||
return [8 * w, 4 * w, 1, 4 * w].join();
|
return [8 * w, 4 * w, 1, 4 * w].join();
|
||||||
default:
|
default:
|
||||||
return style.strokeDashstyle.replace(/ /g, ",");
|
return OpenLayers.String.trim(str).replace(/\s+/g, ",");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user