code: function(style, widthFactor) {
          var w = style.strokeWidth * widthFactor;
          var str = style.strokeDashstyle;
          switch (str) {
              case 'solid':
                  return 'none';
              case 'dot':
                  return [1, 4 * w].join();
              case 'dash':
                  return [4 * w, 4 * w].join();
              case 'dashdot':
                  return [4 * w, 4 * w, 1, 4 * w].join();
              case 'longdash':
                  return [8 * w, 4 * w].join();
              case 'longdashdot':
                  return [8 * w, 4 * w, 1, 4 * w].join();
              default:
                  return OpenLayers.String.trim(str).replace(/\s+/g, ",");
          }
      }
docs: Method: dashStyle
  
  Parameters:
  style - {Object}
  widthFactor - {Number}
  
  Returns:
  {String} A SVG compliant 'stroke-dasharray' value