diff options
author | matthew <matthew> | 2006-09-28 11:10:57 +0000 |
---|---|---|
committer | matthew <matthew> | 2006-09-28 11:10:57 +0000 |
commit | 4a7c2e625003b958871338d729623a626eb1a07f (patch) | |
tree | a3fcabdc457c9a7d92f4e4ae0d7f0597adce7947 /web/js2.js | |
parent | 9475220c2f73e604e77e18c9e5f268ed78560a35 (diff) |
Form state is remembered when clicking the Back button. So can't rely on
that for drawing the correct bit of the map...
Diffstat (limited to 'web/js2.js')
-rw-r--r-- | web/js2.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/web/js2.js b/web/js2.js index ccc89b687..e3d7a2a20 100644 --- a/web/js2.js +++ b/web/js2.js @@ -13,7 +13,6 @@ window.onload = onLoad; // I love the global -var x, y; var tile_x, tile_y; var tilewidth = 254; var tileheight = 254; @@ -34,8 +33,12 @@ function onLoad() { } var form = document.getElementById('mapForm'); - x = parseInt(form.x.value, 10) - 2; /* Bottom left corner X,Y */ - y = parseInt(form.y.value, 10) - 2; + form.onsubmit = function() { + this.x.value = x + 2; + this.y.value = y + 2; + return true; + } + tile_x = 0; tile_y = 0; var url = '/tilma/tileserver/10k-full-london/' + x + '-' + (x+5) + ',' + y + '-' + (y+5) + '/JSON?'; @@ -107,10 +110,6 @@ function update_tiles(dx, dy) { y -= vertical; tile_y = mod((tile_y + vertical), 6); - var form = document.getElementById('mapForm'); - form.x.value = x + 2; - form.y.value = y + 2; - var url = '/tilma/tileserver/10k-full-london/' + x + '-' + (x+5) + ',' + y + '-' + (y+5) + '/JSON'; var req = YAHOO.util.Connect.asyncRequest('GET', url, urls_loaded, null); } |