-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.html
More file actions
33 lines (32 loc) · 1.06 KB
/
map.html
File metadata and controls
33 lines (32 loc) · 1.06 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.js"></script>
<link type="text/css" rel="stylesheet" href="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.css"/>
<section>
<div>
<h3 class="lat">{{.LatLng.Lat}}</h3>
<h3 class="lng">{{.LatLng.Lng}}</h3>
</div>
</section>
<script type="text/javascript">
window.onload = function() {
L.mapquest.key = '6ZAjU5GDUjzJIaU1aMsMEf19AlG4hNCx';
let lat = parseFloat(document.querySelector(".lat").textContent);
let lng = parseFloat(document.querySelector(".lng").textContent);
console.log('->', lat, lng)
var map = L.mapquest.map('map', {
center: [lat, lng],
layers: L.mapquest.tileLayer('map'),
zoom: 12
});
map.addControl(L.mapquest.control());
}
</script>
</head>
<body style="border: 0; margin: 0;">
<div id="map" style="width: 100%; height: 630px;"></div>
</body>
</html>
<html>