-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
43 lines (42 loc) · 1.14 KB
/
index.html
File metadata and controls
43 lines (42 loc) · 1.14 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
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<title>Accessing arguments in UI events</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
#map {
height: 100%;
}
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
function initMap() {
//console.log(window.location.href);
var url_string = window.location.href;
var url = new URL(url_string);
var lat = parseFloat(url.searchParams.get("lat"));
var long = parseFloat(url.searchParams.get("long"));
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 15,
center: {lat: lat, lng: long }
});
var marker;
marker = new google.maps.Marker({
position: new google.maps.LatLng( lat, long),
map: map
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyARz_HOqiVeOPfFClTE5W2A1EMz6S6IL1w&callback=initMap">
</script>
</body>
</html>