How to modify line style of a polyline (V5)

This Page is locked
Modified: 2007/06/25 11:22 by ViaVE Visitor
Usage: shape.Primitives0.symbol.stroke_dashstyle = "LongDashDotDot";

Where other line types can be: other line types Solid, ShortDash, ShortDot, ShortDashDot, ShortDashDotDot, Dot, Dash, LongDash, DashDot, LongDashDot, LongDashDotDot

Sample code:

Code Snippet <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"></script> <script> var map = null; var pinid = 0; function GetMap() { map = new VEMap('myMap'); map.LoadMap(); map.SetZoomLevel(10); } function AddPolyline() { var ll = map.GetCenter(); var lat = ll.Latitude; var lon = ll.Longitude;

var shape = new VEShape(VEShapeType.Polyline, [new VELatLong(lat-0.1,lon-0.1), new VELatLong(lat+0.1,lon-0.1), new VELatLong(lat+0.1,lon), new VELatLong(lat-0.1,lon), new VELatLong(lat-0.1,lon+0.1), new VELatLong(lat+0.1,lon+0.1)]); shape.SetTitle('My polyline'); shape.SetDescription('This is shape number '+pinid); shape.Primitives0.symbol.stroke_dashstyle = "LongDashDotDot"; pinid++; map.AddShape(shape); } </script> </head> <body onload="GetMap();"> <div id='myMap' style="position:relative; width:400px; height:400px;"></div> <div>Click on the links below to add a default shape to the map.</div> <div><a href='#' onclick='AddPolyline();'>Add Polyline</a></div> </body> </html>