forked from Alain1405/leafletjs-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sync-demo.html
51 lines (45 loc) · 1.56 KB
/
sync-demo.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
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8" />
<title>Leaflet Sync Demo - LeafletJS Kit</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;" />
<link type="text/css" rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/leaflet-0.6.2.css" />
<!--[if lte IE 8]> <link rel="stylesheet" href="css/leaflet-0.6.2.ie.css" /> <![endif]-->
<style>
html, body{width:100%; height:100%; margin:0}
#map1, #map2{width:49.5%; height:100%}
#map1{float:left}
#map2{float:right}
</style>
</head>
<body>
<div class="content">
<header role="banner"><h1 class="header-logo">Leaflet Sync Demo - LeafletJS Kit</h1></header>
<div id="map1"></div>
<div id="map2"></div>
<script src="http://cdn.leafletjs.com/leaflet-0.6.2/leaflet-src.js"></script>
<script src="js/L.Map.Sync.js"></script>
<script>
var layer1 = L.tileLayer('http://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=norges_grunnkart&zoom={z}&x={x}&y={y}');
var layer2 = L.tileLayer('http://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=topo2&zoom={z}&x={x}&y={y}', {
attribution: '© Kartverket'
});
var map1 = L.map('map1', {
layers: [layer1],
center: [59.336, 5.967],
zoom: 14
});
map1.attributionControl.setPrefix('');
var map2 = L.map('map2', {
layers: [layer2],
center: [59.336, 5.967],
zoom: 14,
zoomControl: false
});
map1.sync(map2);
map2.sync(map1);
</script>
</body>
</html>