-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBingMapsExample.html
42 lines (33 loc) · 1.57 KB
/
BingMapsExample.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!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 type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
<script type="text/javascript">
var map = null;
function GetMap() {
// Initialize the map
map = new Microsoft.Maps.Map(document.getElementById("mapDiv"),{credentials:"Your Bing Map Credentials"});
var loc1 = new Microsoft.Maps.Location(33.719753, -117.98925);
var loc2 = new Microsoft.Maps.Location(33.993065, -117.918015);
var loc3 = new Microsoft.Maps.Location(34.13095, -118.25497);
// Add a pin to the map
var pin1 = new Microsoft.Maps.Pushpin(loc1);
var pin2 = new Microsoft.Maps.Pushpin(loc2);
var pin3 = new Microsoft.Maps.Pushpin(loc3);
// Create a polyline
var locations = new Array(loc1, loc2, loc3);
var line = new Microsoft.Maps.Polyline(locations);
map.setView({center:loc2, zoom: 9} );
map.entities.push(line);
map.entities.push(pin1);
map.entities.push(pin2);
map.entities.push(pin3);
}
</script>
</head>
<body onload="GetMap();">
<div id='mapDiv' style="position:relative; width:400px; height:400px;"></div>
</body>
</html>