CodeAve.com(Bing Map Simple Polyline - Print View)

Bing Map Simple Polyline

Lines on a map are a useful tool to highlight driving directions, routes, or just the way between two points. In this example a simple five pixel black line is drawn from the coordinates of Boston, New York, Chicago and Los Angeles. All of the code from this simple example can be used to create far more complex routes by adding more points to the line.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>
CodeAve.com/Maps - Bing Maps Polyline Example</title>
<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2">
</script>
<script type="text/javascript">

var map = null; function
GetMap() {
map = new VEMap('myMap'); map.SetDashboardSize(VEDashboardSize.Normal);
map.LoadMap(new VELatLong(39.828180,-98.57955),4,'r',false,VEMapMode.Mode2D); var Polyline_layer = new VEShapeLayer(); var Polyline_coordinates = new VEShape(VEShapeType.Polyline, [ new VELatLong(42.357778,-71.061667),
// Boston new VELatLong(40.716667,-74),
// New York new VELatLong(41.836944,-87.684444),
// Chicago new VELatLong(34.05,-118.25)
// Los Angeles ]); Polyline_coordinates.HideIcon();
// hides the default icon for the polyline Polyline_coordinates.SetLineColor(new VEColor(0,0,0,1));
// sets the linecolor for the border of the polyline Polyline_coordinates.SetLineWidth(5);
// sets the width of the border for the polyline Polyline_coordinates.SetFillColor(new VEColor(255,0,0,.2));
// sets the fill color and the transparency of the fill color Polyline_layer.AddShape(Polyline_coordinates); map.AddShapeLayer(Polyline_layer);
// add the polyline layer to the map } </script>
</head>
<body bgcolor=#FFFFFF onload="
GetMap();">
<table align=center border=0>
<tr>
<td>
<div id="myMap" style="position:relative; width:800px; height:600px;">
</div>
</td>
</tr>
</table>
</body>
</html>


http://www.codeave.com/maps/code.asp?u_log=8710