-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmaps.html
More file actions
40 lines (31 loc) · 1.19 KB
/
maps.html
File metadata and controls
40 lines (31 loc) · 1.19 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Draggable Marker</title>
<!-- This is where we include the Google Maps magic. Make sure to use your key. -->
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=YOUR_API_KEY"></script>
<script type="text/javascript">
// This uses functionality from within the magic. Play with it and learn it :)
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
// We are using Kent's latitude and longitude
var center = new GLatLng(41.1536, -81.3581);
map.setCenter(center, 13);
var marker = new GMarker(center, {draggable: true});
GEvent.addListener(marker, "dragstart", function() {
map.closeInfoWindow();
});
GEvent.addListener(marker, "dragend", function() {
marker.openInfoWindowHtml("Just bouncing along...");
});
map.addOverlay(marker);
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
</body>
</html>