forked from gavinbarron/angular-bing-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolyline-directive.html
52 lines (41 loc) · 2.24 KB
/
polyline-directive.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
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE HTML>
<html>
<head>
<script charset="UTF-8" type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.12/angular.min.js"></script>
<script src="../dist/angular-bing-maps.js"></script>
<script type="text/javascript">
var app = angular.module('angularBingMapExample', ['angularBingMaps']);
app.controller('ExampleController', function($scope, $http) {
/*<bing-map> directive options*/
$scope.mapOptions = {};
$scope.mapOptions.center = {latitude: 30.614919,longitude: -96.342316};
$scope.mapOptions.zoom = 6;
$scope.mapOptions.mapType = 'a';
$scope.polyline = {};
$scope.polyline.locations = [{"latitude":34.86400954439419,"longitude":-90.27786287499998},{"latitude":31.948133803753898,"longitude":-90.16799959374998},{"latitude":31.873525941061587,"longitude":-91.20071443749998},{"latitude":31.948133803753898,"longitude":-89.00344881249998},{"latitude":32.004049978763646,"longitude":-90.21194490624998},{"latitude":35.00811346319084,"longitude":-90.32180818749998},{"latitude":34.97211122247478,"longitude":-88.98147615624998},{"latitude":34.990114322142375,"longitude":-91.50833162499998},{"latitude":34.990114322142375,"longitude":-91.48635896874998}];
$scope.polyline.strokeColor = '#4d1010';
});
</script>
<style type="text/css">
bing-map {
height: 100%;
width: 100%;
}
</style>
</head>
<body ng-app="angularBingMapExample">
<div class="bing-map-container" ng-controller="ExampleController">
<bing-map
credentials="'AkaxzD5YOJCbIvziHVOLfm6AkeM5Z5UQ3dHS53mQzwK-6LGWnxYjAwNqfe3D4UBT'"
center="mapOptions.center"
zoom="mapOptions.zoom"
mapType="mapOptions.mapType">
<polyline
locations="polyline.locations"
stroke-color="polyline.strokeColor">
</polyline>
</bing-map>
</div>
</body>
</html>