2 Copyright (C) 2004-05 Nick Whitelegg, Hogweed Software, nick@hogweed.org
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Lesser GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 Lesser GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
20 // These are functions which manipulate the slippy map in various ways
21 // The idea has been to try and clean up the slippy map API and take code
22 // which does not manipulate it directly outside.
24 var view=0, tileURL, tile_engine;
28 tileURL = 'http://tile.openstreetmap.org/ruby/wmsmod.rbx';
29 tile_engine = new tile_engine_new('drag','FULL','',tileURL,lon,lat,zoom,700,500);
31 tile_engine.setURLAttribute("landsat",1);
33 document.getElementById('zoomout').onclick = zoomOut;
34 document.getElementById('zoomin').onclick = zoomIn;
36 document.getElementById('landsat').onclick = landsatToggle;
39 //document.getElementById('posGo').onclick = setPosition;
44 tile_engine.tile_engine_zoomin();
49 tile_engine.tile_engine_zoomout();
52 function enableTileEngine()
54 tile_engine.event_catch();
57 function landsatToggle()
59 var lsat = tile_engine.getURLAttribute("landsat");
60 tile_engine.setURLAttribute("landsat", (lsat) ? 0: 1);
61 tile_engine.forceRefresh();
64 function setPosition()
67 var txtLat = document.getElementById("txtLat"),
68 txtLon = document.getElementById("txtLon");
70 tile_engine.setLatLon(txtLat, txtLon);