-
Notifications
You must be signed in to change notification settings - Fork 632
/
Copy path0120-basic-double-map-sharing-attributes-example.html
69 lines (65 loc) · 2.53 KB
/
0120-basic-double-map-sharing-attributes-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
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
<!DOCTYPE html>
<html ng-app="demoapp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<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>
<link rel="stylesheet" href="../bower_components/leaflet/dist/leaflet.css" />
<script>
var app = angular.module("demoapp", ["leaflet-directive"]);
app.controller("BasicDoubleMapSharingAttributesController", [ "$scope", "$log", "$http", "leafletData", function($scope, $log, $http, leafletData) {
angular.extend($scope, {
center: {
lat: 43.7350,
lng: -79.3734,
zoom: 11
},
defaults: {
scrollWheelZoom: false
},
markers1: {
one: {
lat: 43.75,
lng: -79.56
},
two: {
lat: 43.76,
lng: -79.50
}
},
markers2: {
one: {
lat: 43.75,
lng: -79.56
},
two: {
lat: 43.75,
lng: -79.45
},
three: {
lat: 43.81,
lng: -79.26
}
}
});
$http.get('json/toronto1.json').success(function(data, status) {
$scope.toronto1 = data;
});
$http.get('json/toronto2.json').success(function(data, status) {
$scope.toronto2 = data;
});
}]);
</script>
</head>
<body ng-controller="BasicDoubleMapSharingAttributesController">
<div style="float: left; width: 50%;">
<leaflet id="map1" geojson="toronto1" defaults="defaults" markers="markers1" center="center" width="100%" height="320px"></leaflet>
</div>
<div style="float: left; width: 50%;">
<leaflet id="map2" geojson="toronto2" defaults="defaults" markers="markers2" center="center" width="100%" height="320px"></leaflet>
</div>
<h1>Two maps sharing center example</h1>
<p>Drag the center in any of the maps</p>
</body>
</html>