forked from tanto/50centimetri
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
100 lines (77 loc) · 3.02 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<title>Confronto Regione Sicilian - RealVista1.0 TILE OPEN</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.css" />
<style type="text/css">
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 id="map1"></div>
<div id="map2"></div>
<script src="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet-src.js"></script>
<script src="./plugins/L.Map.Sync.js"></script>
<script src="./plugins/leaflet-hash.js"></script>
<link rel="stylesheet" href="./plugins/minimap/Control.MiniMap.css" />
<script src="./plugins/minimap/Control.MiniMap.js" type="text/javascript"></script>
<script type="text/javascript">
var center = [38.18886,15.56406];
var zoom = 17;
var sitr = L.tileLayer("http://map.sitr.regione.sicilia.it/gis/rest/services/ATA_2012_2013/Ortofoto_ATA_2012_2013_Messina_14cm/MapServer/tile/{z}/{y}/{x}.png", {
attribution: "Regione Siciliana Assessorato Territorio e Ambiente",
minZoom: 15,
maxZoom: 20
});
var sitr2 = L.tileLayer("http://map.sitr.regione.sicilia.it/ArcGIS/rest/services/CACHED/ortofoto_ata20072008_webmercatore/MapServer/tile/{z}/{y}/{x}.jpg", {
attribution: "Regione Siciliana Assessorato Territorio e Ambiente",
minZoom: 15,
maxZoom: 20
});
var realvista = L.tileLayer.wms("http://213.215.135.196/reflector/open/service?", {
layers: 'rv1',
format: 'image/jpeg',
attribution: "RealVista1.0 e-GEOS SpA | © OpenStreetMap contributors",
minZoom: 15,
maxZoom: 20
});
var map1 = L.map('map1', {
layers: [sitr],
center: center,
zoom: zoom,
minZoom: 15,
maxZoom: 20
});
var map2 = L.map('map2', {
layers: [realvista],
center: center,
zoom: zoom,
minZoom: 15,
maxZoom: 20
});
var marker1 = L.marker([0, 0]).addTo(map1);
map1.on('move', function () {
marker1.setLatLng(map1.getCenter());
marker2.setLatLng(map2.getCenter());
});
var marker2 = L.marker([0, 0]).addTo(map2);
map2.on('move', function () {
marker1.setLatLng(map1.getCenter());
marker2.setLatLng(map2.getCenter());
});
var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib='Map data © OpenStreetMap contributors';
var osm = new L.TileLayer(osmUrl, {minZoom: 5, maxZoom: 18, attribution: osmAttrib});
var osm2 = new L.TileLayer(osmUrl, {minZoom: 0, maxZoom: 13, attribution: osmAttrib });
var miniMap = new L.Control.MiniMap(osm2, { toggleDisplay: true }).addTo(map2);
map1.sync(map2);
map2.sync(map1);
var hash = new L.Hash(map1);
</script>
</body>
</html>