forked from pvarshney1729/Summer-of-Code-18
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeskmap.html
86 lines (66 loc) · 1.75 KB
/
deskmap.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html>
<head>
<title>First Page</title>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#floating-panel {
position: absolute;
top: 10px;
left: 28%;
z-index: 5;
background-color: #fff;
padding: 0px;
border: 1px solid #999;
text-align: center;
font-family: 'Roboto','sans-serif';
line-height: 30px;
padding-left: 0px;
}
button{
height="500px";
width=30%;
}
</style>
</head>
<body>
<div id="map" style="width:20%%;height:25%;"></div>
</div>
<script type="text/javascript">
var map;
var markers = [];
var x = document.getElementById("demo");
function myMap() {
var mapCanvas = document.getElementById("map");
var myCenter=new google.maps.LatLng(28.7041,77.1025);
var mapOptions = {center: myCenter, zoom: 5};
var map = new google.maps.Map(mapCanvas, mapOptions);
//google.maps.event.addListener(map, 'click', function(event) {
placeMarker(map, myCenter);
//});
}
function placeMarker(map, location) {
var marker = new google.maps.Marker({
position: location,
map: map
});
var infowindow = new google.maps.InfoWindow({
content: 'Latitude: ' + location.lat() + '<br>Longitude: ' + location.lng()
});
infowindow.open(map,marker);
markers.push(marker);
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC4qG7WIi9ajrdWEJRZVYZLeV3YcrjEdg8&callback=myMap"></script>
</body>
</html>