This repository has been archived by the owner on Apr 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
demo1.html
117 lines (97 loc) · 3.89 KB
/
demo1.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.js?2"></script>
</head>
<body>
<style>
body { background: #d2d1d0; }
#map {
background: #f4f4f4;
border: 1px solid #bbbbbb;
width: 100%;
height: 360px;
}
</style>
<div id="map">
<style><br>
#map {<br>
width: 100%;<br>
height: 375px;<br>
}<br>
</style>
<br>
<div id="map"></div>
</div>
<script>
// Example 1 - Create a simple map
var map = L.map('map', {
center: [49, 6],
zoom: 13
});
L.tileLayer('http://a.tiles.mapbox.com/v3/eevol.h0194mcj/{z}/{x}/{y}.png', {
}).addTo(map);
// L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
// attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
// }).addTo(map);
// Example 2 - Basic Elements
// var marker = L.marker([49, 5.49]).addTo(map);
// var polygon = L.polygon([
// [51.509, -0.08],
// [51.503, -0.06],
// [51.51, -0.047]
// ]).addTo(map);
// marker.bindPopup("<b>Hello world!</b><br>I am a popup.").openPopup();
// polygon.bindPopup("I am a polygon.");
// Example 3 - Give me that Info
// map.getCenter();
// map.getBounds();
// map.getZoom();
// map.getPixelBounds();
// var map = L.map('map', {
// watch:true
// }).setView([51.505, -0.09], 13);
// // L.tileLayer('http://a.tiles.mapbox.com/v3/eevol.h0194mcj/{z}/{x}/{y}.png', {
// // maxZoom: 18
// // }).addTo(map);
// L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
// attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
// }).addTo(map);
// // Get current position
// map.locate({setView: true, maxZoom: 16});
// function onLocationFound(e) {
// var radius = e.accuracy / 2;
// L.marker(e.latlng).addTo(map)
// .bindPopup("You are within " + radius + " meters from this point").openPopup();
// L.circle(e.latlng, radius).addTo(map);
// }
// map.on('locationfound', onLocationFound);
// // var popup = L.popup();
// // function onMapClick(e) {
// // popup
// // .setLatLng(e.latlng)
// // .setContent("You clicked the map at " + e.latlng.toString())
// // .openOn(map);
// // }
// // map.on('click', onMapClick);
// var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
// imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
// L.imageOverlay(imageUrl, imageBounds).addTo(map);
// var myLines = [{
// "type": "LineString",
// "coordinates": [[-100, 40], [-105, 45], [-110, 55]]
// }, {
// "type": "LineString",
// "coordinates": [[-105, 40], [-110, 45], [-115, 55]]
// }];
// var myStyle = {
// "color": "#ff7800",
// "weight": 5,
// "opacity": 0.65
// };
// L.geoJson(myLines, {
// style: myStyle
// }).addTo(map);
</script>
</body>
</html>