-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
61 lines (51 loc) · 1.33 KB
/
index.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
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<!-- bower:js -->
<script src="bower_components/angular/angular.js"></script>
<!-- endbower -->
<script src="dist/angular-baidu-map.js"></script>
<style>
.map {
display: block;
width: 640px;
height: 480px;
}
</style>
</head>
<body ng-app="app" ng-controller="TestController as testCtrl">
<div ng-init="point = { lng: 121.491, lat: 31.233 }">
<div>
<span>lat:</span>
<span ng-bind="point.lat"></span>
<input type="number" ng-model="point.lat" />
</div>
<div>
<span>lng:</span>
<span ng-bind="point.lng"></span>
<input type="number" ng-model="point.lng" />
</div>
<baidu-map class="map" center="point">
<marker latlng="point" map-click="test()">
<h1>title</h1>
<p>你好世界</p>
<button ng-click="testCtrl.click()">push me</button>
</marker>
</baidu-map>
</div>
<script>
angular.module('app', ['ngBaiduMap']).config(config)
.controller('TestController', TestController);
function config(baiduMapApiProvider) {
baiduMapApiProvider.accessKey('Ivgr94UBpL6zkp4lUZRtQCys');
}
function TestController($scope) {
this.click = function() {
debugger;
};
}
</script>
</body>
</html>