-
Notifications
You must be signed in to change notification settings - Fork 0
/
leaflet01-createmap.html
40 lines (30 loc) · 1.11 KB
/
leaflet01-createmap.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
<!DOCTYPE html>
<html>
<head>
<title>Map</title>
<!-- Load Leaflet.js and styles from a CDN -->
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<style type="text/css">
#map {width: 100%; height: 600px;}
</style>
</head>
<body>
<!-- The div where the map goes -->
<div id="map"></div>
<!-- Map javascript -->
<script type="text/javascript">
// Create a map
var map = L.map('map')
.setView([52.2015, 0.127], 17); // Easy way to work out lat/lon/zoom is http://www.openstreetmap.org/
// Add tile background
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// Add marker
L.marker([52.20203, 0.12466]).addTo(map)
.bindPopup("We're here at Novi!<br />Hi PHP Cambridge :)")
.openPopup();
</script>
</body>
</html>