-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmap.html
85 lines (74 loc) · 2.45 KB
/
map.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
85
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="copyright" content="Markus Weissmann" />
<meta name="author" content="Markus Weissmann" />
<meta http-equiv="content-type" content=
"text/html; charset=us-ascii" />
<title>MacPorts Developers Locations</title>
</head>
<body>
<h2 id="id_developers_locations"><a href="http://www.macports.org/">MacPorts</a> Developers Locations</h2>
<script src="http://maps.google.com/maps?file=api&v=1&key=ABQIAAAA5HP32Y5kUf3iJ0ZPhQhMXBR3CdQj7cR9TjBrGtZFa91sBvPPthSEOD82Knrp2yPDBDN5Wib3QL0yZQ"
type="text/javascript">
</script>
<div id="map" style="width: 1000px; height: 600px"></div>
<script type="text/javascript">
//<![CDATA[
// Show map
var map = new GMap(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.centerAndZoom(new GPoint(0, 10), 15);
// Create marker icon
var icon = new Object();
icon = new GIcon();
icon.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png";
icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize = new GSize(12, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);
// Place a marker
function addMarker(point, name, mail, image, aux) {
var marker = new GMarker(point, icon);
map.addOverlay(marker);
// test for empty values
if ("" == mail) {
return;
}
if ("" == image) {
image="images/take_it_tux48.png";
}
if ("" == name) {
name = mail;
}
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<img width='48' height='48' src='" + image + "'/> <a href=\"mailto:" + mail + "\"><tt>" + name + "</tt></a><br/>" + aux);
});
}
// Download data and show it
var request = GXmlHttp.create();
request.open("GET", "macports.markers.xml", true);
request.onreadystatechange = function() {
if (request.readyState == 4) {
var xmlDoc = request.responseXML;
var markers = xmlDoc.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
var point = new GPoint(parseFloat(markers[i].getAttribute("long")),
parseFloat(markers[i].getAttribute("lat")));
addMarker(point,
markers[i].getAttribute("name"),
markers[i].getAttribute("mail"),
markers[i].getAttribute("image"),
""
);
}
}
}
request.send(null);
//]]>
</script>
</body>
</html>