forked from billiam001/stephenturner.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
01_leaflet.html
107 lines (86 loc) · 3.75 KB
/
01_leaflet.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ex. 1: Web Mapping</title>
<link rel="stylesheet" href="styles/bootstrap.min.css" >
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
crossorigin=""/>
<style type="text/css">
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="/">Lab 5: Web Mapping</a>
<div>
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="/">« Back <span class="sr-only">(current)</span></a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="row mt-5">
<div class="col">
<div id="map-holder" style="min-height: 500px;"></div>
</div>
</div>
</div>
<script src="scripts/vendor/jquery.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="
crossorigin=""></script>
<script>
$(document).ready(function(){
var firstMap = new L.Map('map-holder', {
center: new L.LatLng(53.408, -9.128),
zoom: 9
});
L.tileLayer('http://{s}.tile.openstreetmap.se/hydda/full/{z}/{x}/{y}.png', {
minZoom: 7,
maxZoom: 15,
noWrap: true,
attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> — Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
}).addTo(firstMap);
// ------------------------------
// Swap the base layer
// ------------------------------
// L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.{ext}', {
// attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
// subdomains: 'abcd',
// noWrap: true,
// ext: 'png'
// }).addTo(firstMap);
// ------------------------------
// Add a Marker
// ------------------------------
L.marker([53.27392, -9.05102])
.addTo(firstMap)
.bindPopup('A marker on Galway!')
.openPopup();
// ------------------------------
// Add a circle
// ------------------------------
// var circle = L.circle([53.408, -9.128], {
// color: 'red',
// fillColor: '#f03',
// fillOpacity: 0.5,
// radius: 500
// }).addTo(firstMap);
// ------------------------------
// Add a circleMarker (comment out circle
// above first)
// ------------------------------
var circle = L.circleMarker([53.408, -9.128], {
color: 'red',
fillColor: '#f03',
fillOpacity: 0.5,
radius: 10
}).addTo(firstMap);
//
});
</script>
</body>
</html>