-
Notifications
You must be signed in to change notification settings - Fork 0
/
thatcher-map.html
27 lines (24 loc) · 1.04 KB
/
thatcher-map.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
<head>
...
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" crossorigin=""></script>
Code an interactive map using leaflet JS whose data has a pin on James Thatcher's house in Tacoma, Washington
...
</head>
<body>
...
<div id="map"></div>
...
</body>
<script>
// initialize the map and set its view to the coordinates of James Thatcher's house in Tacoma, Washington
var map = L.map('map').setView([47.2529, -122.4443], 13);
// add a tile layer to the map
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors',
maxZoom: 18
}).addTo(map);
// add a marker on the map at the coordinates of James Thatcher's house
var marker = L.marker([47.2529, -122.4443]).addTo(map);
// add a popup to the marker
marker.bindPopup("<b>James Thatcher's House</b><br>Tacoma, Washington").openPopup();
</script>