//depot/projects/wardrive-map/map.html#1 – add change 124 (text) ·revision history
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | <head> |
| 5 | <title>ttul wardrive map</title> |
| 6 | <script src="http://maps.google.com/maps?file=api&v=1&key=ABQIAAAA_FAKE_KEY_FOR_TTUL_ORG" type="text/javascript"></script> |
| 7 | <style type="text/css"> |
| 8 | body { font-family: Verdana, sans-serif; font-size: 80%; } |
| 9 | #map { width: 700px; height: 500px; border: 1px solid #999; } |
| 10 | </style> |
| 11 | </head> |
| 12 | <body> |
| 13 | <h1>Access points of Vancouver</h1> |
| 14 | <div id="map"></div> |
| 15 | <p id="status">loading...</p> |
| 16 | <script type="text/javascript"> |
| 17 | //<![CDATA[ |
| 18 | var map = new GMap(document.getElementById("map")); |
| 19 | map.addControl(new GLargeMapControl()); |
| 20 | map.centerAndZoom(new GPoint(-123.1207, 49.2827), 4); |
| 21 | |
| 22 | function getXHR() { |
| 23 | if (window.XMLHttpRequest) return new XMLHttpRequest(); |
| 24 | return new ActiveXObject("Microsoft.XMLHTTP"); |
| 25 | } |
| 26 | |
| 27 | var req = getXHR(); |
| 28 | req.open("GET", "nets.xml", true); |
| 29 | req.onreadystatechange = function() { |
| 30 | if (req.readyState != 4) return; |
| 31 | var nets = req.responseXML.documentElement.getElementsByTagName("net"); |
| 32 | for (var i = 0; i < nets.length; i++) { |
| 33 | var p = new GPoint(parseFloat(nets[i].getAttribute("lng")), |
| 34 | parseFloat(nets[i].getAttribute("lat"))); |
| 35 | map.addOverlay(new GMarker(p)); |
| 36 | } |
| 37 | document.getElementById("status").innerHTML = nets.length + " networks"; |
| 38 | }; |
| 39 | req.send(null); |
| 40 | //]]> |
| 41 | </script> |
| 42 | </body> |
| 43 | </html> |