-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.html
60 lines (40 loc) · 1.7 KB
/
index2.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
<!DOCTYPE html>
<html>
<head>
<title>Geog 483 Leaflet Tutorial</title>
<!-- This tutorial is based on the official Leaflet quickstart: http://leafletjs.com/examples/quick-start/ -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
</head>
<body>
<style>
body { margin:0; padding:0; }
#mapid { position:absolute; top:50px; bottom:50px; left:50px; width:500px; height:500px;}
#UWaterloo {width:300px; height:200px;}
#UWIcon {width:42px; height:45px;}
</style>
<div id="mapid"</div>
<script>
var mymap = L.map('mapid').setView([43.466, -80.53], 14);
var Icon = L.icon({
iconUrl: 'UWIcon.png',
iconSize: [200,120],
popupAnchor: [0, -25]
})
L.tileLayer("http://tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, '
}).addTo(mymap);
L.marker([43.466, -80.53], {icon: Icon}).addTo(mymap)
.bindPopup("<b>Popups</b><br/>1.Link<br/>2.Image<br/>3.Linked Image").openPopup();
L.marker([43.463, -80.52]).addTo(mymap)
.bindPopup("<a href='https://uwaterloo.ca/'> Uwaterloo Website </a>");
L.marker([43.461, -80.534]).addTo(mymap)
.bindPopup("<img id='UWaterloo' src='Uwaterloo.jpg'>");
L.marker([43.466, -80.54]).addTo(mymap)
.bindPopup("<a href='http://www.varsity.uwaterloo.ca/'> <img id='UWIcon' src='Warriors.jpg'> </a>");
</script>
</body>
</html>