aboutsummaryrefslogtreecommitdiffstats
path: root/web/js.js
diff options
context:
space:
mode:
authormatthew <matthew>2008-09-16 15:45:09 +0000
committermatthew <matthew>2008-09-16 15:45:09 +0000
commitb7545d35f57d4967cc81f80606132345755ed84e (patch)
tree8fc5bd4c7e7af30df425622deb05a7f191f28f1a /web/js.js
parent3f58bc0b7b6be8018ab2835c35b825fd9be887bb (diff)
Update pins/list as you drag the map, rearrange list display.
Diffstat (limited to 'web/js.js')
-rw-r--r--web/js.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/web/js.js b/web/js.js
index 2a52ab423..7f4add8c1 100644
--- a/web/js.js
+++ b/web/js.js
@@ -249,10 +249,30 @@ function update_tiles(dx, dy, force) {
tile_y += vertical;
var url = [ '/tilma/tileserver/10k-full/', x, '-', (x+5), ',', y, '-', (y+5), '/JSON' ].join('');
- var req = YAHOO.util.Connect.asyncRequest('GET', url, {
+ YAHOO.util.Connect.asyncRequest('GET', url, {
success: urls_loaded, failure: urls_not_loaded,
argument: [tile_x, tile_y]
});
+
+ if (force) return;
+
+ url = [ '/ajax?sx=', document.getElementById('formX').value, ';sy=',
+ document.getElementById('formY').value, ';x=', (x+2), ';y=', (y+2)
+ ].join('');
+ YAHOO.util.Connect.asyncRequest('GET', url, {
+ success: pins_loaded
+ });
+}
+
+function pins_loaded(o) {
+ var data = eval(o.responseText);
+ document.getElementById('pins').innerHTML = data.pins;
+ if (typeof(data.current) != 'undefined')
+ document.getElementById('current').innerHTML = data.current;
+ if (typeof(data.current_near) != 'undefined')
+ document.getElementById('current_near').innerHTML = data.current_near;
+ if (typeof(data.fixed_near) != 'undefined')
+ document.getElementById('fixed_near').innerHTML = data.fixed_near;
}
function urls_not_loaded(o) { /* Nothing yet */ }