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

Bing Map Simple Polygon

Polygons are a useful way to highlight portions of a map. By specifying a series of coordinates the polygon will form a closed loop and define a filled region within your map. In this example the coordinates of the four corners of the state of Colorado are represented. The area in-between is filled in based on parameters as well as the color of the border area.
<!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>
Map of Colorado</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.554883,-105.776367),6,'r',false,VEMapMode.Mode2D); map.SetScaleBarDistanceUnit(VEDistanceUnit.Miles); map.ShowMiniMap(0,390); var Colorado_layer = new VEShapeLayer(); var Colorado_coordinates = new VEShape(VEShapeType.Polygon, [ new VELatLong(40.963308,-109.050293), new VELatLong(36.993778,-109.039307), new VELatLong(37.002553,-102.052002), new VELatLong(40.996484,-102.073975) ]); Colorado_coordinates.HideIcon();
// hides the default icon for the polygon Colorado_coordinates.SetLineColor(new VEColor(0,0,0,1));
// sets the linecolor for the border of the polygon Colorado_coordinates.SetLineWidth(2);
// sets the width of the border for the polygon Colorado_coordinates.SetFillColor(new VEColor(255,0,0,.2));
// sets the fill color and the transparency of the fill color Colorado_layer.AddShape(Colorado_coordinates); map.AddShapeLayer(Colorado_layer);
// add the polygon shape 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=8708