Ticket #1126: strokeDash.00.patch
| File strokeDash.00.patch, 2.9 kB (added by fredj, 10 months ago) |
|---|
-
lib/OpenLayers/Feature/Vector.js
old new 276 276 strokeOpacity: 1, 277 277 strokeWidth: 1, 278 278 strokeLinecap: "round", 279 strokeDashstyle: "dot", 279 280 hoverStrokeColor: "red", 280 281 hoverStrokeOpacity: 1, 281 282 hoverStrokeWidth: 0.2, … … 293 294 strokeOpacity: 1, 294 295 strokeWidth: 2, 295 296 strokeLinecap: "round", 297 strokeDashstyle: "solid", 296 298 hoverStrokeColor: "red", 297 299 hoverStrokeOpacity: 1, 298 300 hoverStrokeWidth: 0.2, … … 311 313 strokeOpacity: 1, 312 314 strokeLinecap: "round", 313 315 strokeWidth: 4, 316 strokeDashstyle: "solid", 314 317 hoverStrokeColor: "red", 315 318 hoverStrokeOpacity: 1, 316 319 hoverStrokeWidth: 0.2, -
lib/OpenLayers/Renderer/VML.js
old new 244 244 } 245 245 stroke.setAttribute("opacity", style.strokeOpacity); 246 246 stroke.setAttribute("endcap", !style.strokeLinecap || style.strokeLinecap == 'butt' ? 'flat' : style.strokeLinecap); 247 stroke.setAttribute("dashstyle", style.strokeDashstyle); 247 248 } 248 249 249 250 if (style.cursor) { -
lib/OpenLayers/Renderer/SVG.js
old new 236 236 node.setAttributeNS(null, "stroke-opacity", style.strokeOpacity); 237 237 node.setAttributeNS(null, "stroke-width", style.strokeWidth); 238 238 node.setAttributeNS(null, "stroke-linecap", style.strokeLinecap); 239 node.setAttributeNS(null, "stroke-dasharray", this.dashStyle(style)); 239 240 } else { 240 241 node.setAttributeNS(null, "stroke", "none"); 241 242 } … … 250 251 }, 251 252 252 253 /** 254 * Method: dashStyle 255 * 256 * Parameters: 257 * style - {Object} 258 * 259 * Returns: 260 * {String} A SVG compliant 'stroke-dasharray' value 261 */ 262 dashStyle: function(style) { 263 var w = style.strokeWidth; 264 265 switch (style.strokeDashstyle) { 266 case 'dot': 267 return [w, 2 * w].join(); 268 case 'dash': 269 return [4 * w, 4 * w].join(); 270 case 'dashdot': 271 return [5 * w, 5 * w, w, 5 * w].join(); 272 case 'longdash': 273 return [8 * w, 5 * w].join(); 274 case 'longdashdot': 275 return [8 * w, 5 * w, w, 5 * w].join(); 276 case 'solid': 277 default: 278 return 'none'; 279 } 280 }, 281 282 /** 253 283 * Method: createNode 254 284 * 255 285 * Parameters:
