| @@ -25,8 +25,18 @@ | ||
| 25 | 25 | return new ActiveXObject("Microsoft.XMLHTTP"); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | function makeMarker(p, html) { | |
| 29 | var m = new GMarker(p); | |
| 28 | function pin(color) { | |
| 29 | var icon = new GIcon(); | |
| 30 | icon.image = "icons/" + color + ".png"; | |
| 31 | icon.iconSize = new GSize(12, 20); | |
| 32 | icon.iconAnchor = new GPoint(6, 20); | |
| 33 | icon.infoWindowAnchor = new GPoint(5, 1); | |
| 34 | return icon; | |
| 35 | } | |
| 36 | var openPin = pin("green"), wepPin = pin("red"); | |
| 37 | ||
| 38 | function makeMarker(p, icon, html) { | |
| 39 | var m = new GMarker(p, icon); | |
| 30 | 40 | GEvent.addListener(m, "click", function() { m.openInfoWindowHtml(html); }); |
| 31 | 41 | return m; |
| 32 | 42 | } |
| @@ -41,7 +51,8 @@ | ||
| 41 | 51 | parseFloat(nets[i].getAttribute("lat"))); |
| 42 | 52 | var html = "<b>" + nets[i].getAttribute("ssid") + "</b><br/>ch " + |
| 43 | 53 | nets[i].getAttribute("chan"); |
| 44 | map.addOverlay(makeMarker(p, html)); | |
| 54 | var icon = nets[i].getAttribute("wep") == "1" ? wepPin : openPin; | |
| 55 | map.addOverlay(makeMarker(p, icon, html)); | |
| 45 | 56 | } |
| 46 | 57 | document.getElementById("status").innerHTML = nets.length + " networks"; |
| 47 | 58 | }; |