-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
53 lines (45 loc) · 1.19 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Google Maps Test</title>
<style>
#map {
height: 400px;
width: 100%;
}
</style>
</head>
<body>
<h3>Simple Marker</h3>
<div id="map"></div>
<script>
function initMap() {
//Location
var mySingleLocation = {lat: 47.3769, lng: 8.5417}; //Zürich
//Map Options
var options = {
zoom: 8,
center: mySingleLocation
};
//Init Map
var map = new google.maps.Map(document.getElementById('map'), options);
//Add Marker
var marker = new google.maps.Marker({
position: mySingleLocation,
map: map,
icon: 'img/location_02.png'
});
//Init Info Window of Marker
var infoWindow = new google.maps.InfoWindow({
content: 'Hallo'
});
//Get Info Window of Marker
marker.addListener('click', function(){
infoWindow.open(map, marker);
})
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDsm8sjiU9JAfnxnFFO5Jq7MsgNoGcvT7w&callback=initMap"></script>
</body>
</html>