-
Notifications
You must be signed in to change notification settings - Fork 632
/
Copy path0102-basic-center-autodiscover-example.html
38 lines (36 loc) · 1.44 KB
/
0102-basic-center-autodiscover-example.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
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../bower_components/leaflet/dist/leaflet.css" />
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/leaflet/dist/leaflet.js"></script><script src="../bower_components/angular-simple-logger/dist/index.js"></script>
<script src="../dist/angular-leaflet-directive.min.js"></script>
<script>
var app = angular.module('demoapp', ['leaflet-directive']);
app.controller('BasicCenterAutodiscoverController', [ '$scope', function($scope) {
angular.extend($scope, {
center: {
autoDiscover: true
}
});
}]);
</script>
<style>
input {
width: 100px;
margin-right: 7px;
}
</style>
</head>
<body ng-controller="BasicCenterAutodiscoverController">
<leaflet center="center" width="100%" height="480px"></leaflet>
<h1>Center autodiscover example</h1>
<ul>
<li><input type="number" step="any" ng-model="center.lat" /> Latitude</li>
<li><input type="number" step="any" ng-model="center.lng" /> Longitude</li>
<li><input type="number" step="any" ng-model="center.zoom" /> Zoom</li>
</ul>
<button ng-click="center.autoDiscover=true">Discover position</button>
</body>
</html>