CodeAve.com CodeAve.com - Maps - Bing Maps
ASP
JavaScript
CSS
HTML
Maps
·Map Script Writers
·Bing Maps
·Google Maps
·Contents
Links
Mail List
Search
Sitemap


 


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.
View the Output
Text View
Print View
Mail this Link

<!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>

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved