annotate linkmap.html @ 0:fb5784aa45e6 default tip

from monotone. problematic https vs v2 API
author Matt Johnston <matt@ucc.asn.au>
date Sun, 21 Oct 2012 23:03:51 +0800
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
3 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
4 <head>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
5 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
6
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
7 <title>Link Map</title>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
8
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
9 <style type="text/css"><!--
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
10 body{font-family: sans-serif; height:99%; margin:0; padding:0;}
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
11 html{height:99%; margin:0; padding:0;}
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
12 #error_log {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
13 font-family: Courier, "Courier New", monospace, Fixed;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
14 border: 3px solid red;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
15 padding: 0.5em;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
16 margin: 0.5em;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
17 display: none;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
18 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
19 #map_canvas {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
20 height:99%;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
21 width: 100%;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
22 margin:0;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
23 padding:0;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
24 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
25
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
26 #legend {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
27 font-size: small;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
28 background-color: #fff;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
29 opacity: 0.7;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
30 text-align: left;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
31 padding: 0.5em;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
32 border: 1px solid black;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
33 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
34
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
35 #legend div {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
36 vertical-align: middle;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
37 display: inline-block;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
38 margin-right: 1em;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
39 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
40
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
41 .node_label_id {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
42 font-size: smaller;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
43 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
44 .node_marker_label {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
45 font-size: small;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
46 font-weight: bold;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
47 color: #800;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
48 opacity: 0.9;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
49 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
50 //-->
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
51 </style>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
52
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
53 <script>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
54 // define some constants for colours etc:
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
55 LINKED_ICON = 'bluedot.png';
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
56 UNLINKED_ICON = 'yellowdot.png';
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
57 ICON_SIZE_W = 18;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
58 ICON_SIZE_H = 18;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
59
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
60 LINK_COLOUR_5GHZ = '#080';
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
61 LINK_COLOUR_2GHZ = '#00f';
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
62 LINK_COLOUR_VPN = '#777';
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
63 LINK_OPACITY = 0.7;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
64 LINK_WIDTH = 4;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
65
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
66 LEGEND_X_OFFSET = 7;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
67 LEGEND_Y_OFFSET = 240;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
68
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
69 CENTRE_COORDS_LAT = -31.9554;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
70 CENTRE_COORDS_LNG = 115.85859;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
71
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
72 // Note that these don't really help with privacy - people
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
73 // can always inspect the raw javascript. Manually alter coordinates
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
74 // if desired.
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
75 MAX_ZOOM = 13;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
76 MIN_ZOOM = 3;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
77 INIT_ZOOM = 10;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
78
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
79 </script>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
80
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
81 <!-- load the nodes and links. -->
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
82 <script src="freenet_data.js"></script>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
83
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
84 <script>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
85
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
86 var key = {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
87 'localhost': 'ABQIAAAAN6v4BE-QSU4eUIUlNyDwJBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQeuZtV4Gh5jn5-Mzkw8HaJ-hZUxQ',
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
88 'matt.ucc.asn.au': 'ABQIAAAAN6v4BE-QSU4eUIUlNyDwJBTcvFJ22Qq_4Wpg4VhVaFRl5W3cyxRmrAk6RVdmqxBPO7KK8gwSWsrFVg',
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
89 'www.wafreenet.org': 'ABQIAAAAN6v4BE-QSU4eUIUlNyDwJBRTyFF_GlE7_llDeWLTuKgydpOCLhQydqjQALO8ZGbbZw5VaoTB-DBcMw',
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
90 }[window.location.host]
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
91 if (!key) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
92 key =
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
93 'ABQIAAAAN6v4BE-QSU4eUIUlNyDwJBTR5ei7CukQRzAV2g5VZ7MlqVyAPxSs6pg6K2o24gSmaclijIuM-Q9KcA';
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
94 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
95 document.write([
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
96 '<script src="https://maps.google.com/maps?file=api&amp;v=2&amp;key=',
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
97 key,
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
98 '" type="text/javascript"><\/script>'
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
99 ].join(''));
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
100 </script>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
101
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
102 <!-- 3rd party labelled marker code -->
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
103 <script src="labeled_marker.js"></script>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
104
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
105 <script type="text/javascript">
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
106
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
107 // define a few constants after loading the gmaps API
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
108 ICON_SIZE = new GSize(ICON_SIZE_W, ICON_SIZE_H);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
109 CENTRE_COORDS = new GLatLng(CENTRE_COORDS_LAT, CENTRE_COORDS_LNG);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
110
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
111 function add_node(map, nodeid, lat, lng, name, desc, url, is_linked) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
112 var latlng = GLatLng.fromUrlValue('')
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
113 var latlng = new GLatLng(lat, lng);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
114
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
115 var icon = new GIcon(G_DEFAULT_ICON);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
116 icon.shadow = "";
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
117 if (is_linked) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
118 icon.image = LINKED_ICON;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
119 } else {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
120 icon.image = UNLINKED_ICON;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
121 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
122 var middle = new GPoint(ICON_SIZE.width / 2.0, ICON_SIZE.height / 2.0);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
123 icon.iconAnchor = middle;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
124 icon.infoWindowAnchor = middle;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
125 icon.iconSize = ICON_SIZE;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
126
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
127 var marker_opts = {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
128 icon: icon,
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
129 labelText: '<div class="node_marker_label">' + name + "</div>",
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
130 labelOffset: new GSize(ICON_SIZE.width/2.0, 0),
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
131 };
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
132
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
133 var marker = new LabeledMarker(latlng, marker_opts);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
134
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
135 var desc_text = '';
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
136 if (desc) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
137 desc_text = '<br/>' + desc;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
138 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
139
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
140 var name_text = nodeid;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
141 if (name) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
142 name_text = name;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
143 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
144 if (url) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
145 name_text = '<a href="' + url + '">' + name_text + '</a>';
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
146 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
147 var myhtml = '<div class="node_label"><b>' + name_text + "</b>" + desc_text + '<br/><div class="node_label_id">' + nodeid + "</div></div>";
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
148 GEvent.addListener(marker, "click", function() {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
149 map.openInfoWindowHtml(latlng, myhtml);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
150 });
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
151 map.addOverlay(marker);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
152 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
153
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
154 function add_link(map, kind, lat1, lng1, lat2, lng2) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
155 var pos1 = new GLatLng(lat1, lng1);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
156 var pos2 = new GLatLng(lat2, lng2);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
157 var polyOptions = {geodesic:true};
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
158
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
159 // line styling defined here.
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
160 var colour = null;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
161 if (kind == '2ghz') {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
162 colour = LINK_COLOUR_2GHZ;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
163 } else if (kind == '5ghz') {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
164 colour = LINK_COLOUR_5GHZ;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
165 } else if (kind == 'vpn') {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
166 colour = LINK_COLOUR_VPN;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
167 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
168 else {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
169 throw ("Link kind '" + kind + "' is not known.");
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
170 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
171
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
172 var line = new GPolyline([
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
173 pos1, pos2,
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
174 ], colour, LINK_WIDTH, LINK_OPACITY, polyOptions);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
175 map.addOverlay(line);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
176 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
177
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
178 function make_legend(map, legend_html) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
179 // from
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
180 // http://code.google.com/apis/maps/documentation/examples/control-custom.html
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
181 function LegendControl() {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
182 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
183
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
184 LegendControl.prototype = new GControl();
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
185
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
186 // Creates a one DIV for each of the buttons and places them in a container
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
187 // DIV which is returned as our control element. We add the control to
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
188 // to the map container and return the element for the map class to
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
189 // position properly.
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
190 LegendControl.prototype.initialize = function(map) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
191 var legendDiv = document.createElement("div");
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
192 legendDiv.id = "legend";
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
193 legendDiv.innerHTML = legend_html;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
194
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
195 var container = document.createElement("div");
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
196 container.appendChild(legendDiv);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
197 map.getContainer().appendChild(container);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
198 return container;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
199 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
200
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
201 // By default, the control will appear in the top left corner of the
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
202 // map with 7 pixels of padding.
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
203 LegendControl.prototype.getDefaultPosition = function() {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
204 return new GControlPosition(G_ANCHOR_TOP_LEFT,
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
205 new GSize(LEGEND_X_OFFSET, LEGEND_Y_OFFSET));
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
206 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
207
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
208 map.addControl(new LegendControl());
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
209 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
210
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
211 function limit_zoom(map, minMapScale, maxMapScale) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
212 // get array of map types
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
213 var mapTypes = map.getMapTypes();
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
214 // overwrite the getMinimumResolution() and getMaximumResolution() methods
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
215 // for each map type
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
216 for (var i=0; i<mapTypes.length; i++) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
217 mapTypes[i].getMinimumResolution = function() {return minMapScale;}
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
218 mapTypes[i].getMaximumResolution = function() {return maxMapScale;}
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
219 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
220 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
221
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
222 function initialize() {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
223 if (GBrowserIsCompatible()) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
224 var map = new GMap2(document.getElementById("map_canvas"));
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
225
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
226 // turn on the zoom and terrain/sat buttons
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
227
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
228 var customUI = map.getDefaultUI();
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
229 customUI.maptypes.hybrid = false;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
230 customUI.controls.scalecontrol = false;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
231 map.setUI(customUI);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
232
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
233 map.setMapType(G_PHYSICAL_MAP);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
234 map.enableContinuousZoom();
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
235
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
236 limit_zoom(map, MIN_ZOOM, MAX_ZOOM);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
237
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
238 // centered kind of on perth city.
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
239 map.setCenter(CENTRE_COORDS, INIT_ZOOM);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
240
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
241 var legend_html = '<div><img src="' + LINKED_ICON + '"/></div><div>Linked Node</div>'
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
242 + '<br/><div><img src="' + UNLINKED_ICON + '"/></div><div>Unlinked Node</div>'
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
243 + '<br/><div style="background-color: ' + LINK_COLOUR_5GHZ + '; width: 3em; height: ' + LINK_WIDTH + 'px"></div><div>5GHz Link</div>'
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
244 + '<br/><div style="background-color: ' + LINK_COLOUR_2GHZ + '; width: 3em; height: ' + LINK_WIDTH + 'px"></div><div>2GHz Link</div>'
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
245 + '<br/><div style="background-color: ' + LINK_COLOUR_VPN + '; width: 3em; height: ' + LINK_WIDTH + 'px"></div><div>VPN Link</div>'
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
246 ;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
247 ;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
248 make_legend(map, legend_html);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
249
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
250 var linked_nodes = {};
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
251 for (var i = 0; i < freenet_links.length; i++)
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
252 {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
253 try {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
254 var l = freenet_links[i];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
255 var kind = l[0];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
256 var nodeid1 = l[1];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
257 var nodeid2 = l[2];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
258
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
259 var node1 = freenet_nodes[nodeid1];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
260 var node2 = freenet_nodes[nodeid2];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
261
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
262 if (node1 == undefined) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
263 throw "Node ID " + nodeid1 + " is not in the node list.";
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
264 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
265 if (node2 == undefined) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
266 throw "Node ID " + nodeid2 + " is not in the node list.";
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
267 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
268
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
269 if (kind != 'vpn') {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
270 linked_nodes[nodeid1] = true;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
271 linked_nodes[nodeid2] = true;
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
272 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
273
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
274 var lat1 = node1[0];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
275 var lng1 = node1[1];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
276 var lat2 = node2[0];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
277 var lng2 = node2[1];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
278
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
279 add_link(map, kind, lat1, lng1, lat2, lng2);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
280 } catch (e) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
281 var error_log = document.getElementById("error_log");
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
282 error_log.innerHTML += "Error adding node link '" +
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
283 l + "': '" + String(e) + "'<br/>";
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
284 error_log.style.display = "block";
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
285 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
286 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
287
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
288 for (var nodeid in freenet_nodes) {
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
289 var n = freenet_nodes[nodeid];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
290 var lat = n[0];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
291 var lng = n[1];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
292 var name = n[2];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
293 var desc = n[3];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
294 var url = n[4];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
295 var is_linked = linked_nodes[nodeid];
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
296 add_node(map, nodeid, lat, lng, name, desc, url, is_linked);
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
297 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
298 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
299 }
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
300
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
301 </script>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
302 </head>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
303 <body onload="initialize()" onunload="GUnload()">
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
304 <div id="error_log"></div>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
305 <div id="map_canvas"></div>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
306 </body>
fb5784aa45e6 from monotone. problematic https vs v2 API
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
307 </html>