forked from tombatossals/angular-leaflet-directive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfull-example.html
More file actions
78 lines (73 loc) · 1.83 KB
/
full-example.html
File metadata and controls
78 lines (73 loc) · 1.83 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<html ng-app="demoapp">
<head>
<script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>
<script src="angular-leaflet-directive.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" />
<link rel="stylesheet" href="angular-leaflet-directive.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4/leaflet.ie.css" />
<![endif]-->
<script>
angular.module("demoapp", ["leaflet-directive"]);
function DemoController($scope) {
angular.extend($scope, {
// set up map center
cen: {
lat: 51.505,
lng: -0.09,
},
// set up main marker
mark: {
lat: 51.505,
lng: -0.09,
},
msg: "Hello World!",
// set up multiple markers on map
multimarkers: {
'm1': {
lat: 51,
lng: 0,
draggable: true,
},
'm2': {
lat: 51.2,
lng: -0.01,
},
},
});
};
</script>
<style>
div.map {
width: 640px;
height: 480px;
}
</style>
</head>
<body ng-controller="DemoController">
<leaflet center="cen" zoom="zoom" message="msg"
marker="mark" multimarkers="multimarkers">
</leaflet>
</br>
Center:
<input type="text" ng-model="cen.lng"/>
<input type="text" ng-model="cen.lat"/>
<input type="text" ng-model="zoom"/>
</br>
Marker:
<input type="text" ng-model="mark.lng"/>
<input type="text" ng-model="mark.lat"/>
</br>
Message:
<input type="text" ng-model="msg"/>
</br>
<p>Markers</p>
<div ng-repeat="(name, m) in multimarkers">
<b>{{name}}</b>:
lng: <input type="text" ng-model="m.lng"/>
lat: <input type="text" ng-model="m.lat"/>
<b>{{m.draggable && 'draggable'}}</b>
</div>
</body>
</html>