Skip to content

Commit 568403e

Browse files
added Bing's ordnance survey map, #41
1 parent fb5caab commit 568403e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

js/tracker.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,25 @@ function update_lookangles(idx) {
151151
$("#lookanglesbox .range").text(range_string);
152152
}
153153

154+
function makeQuad(x, y, zoom) {
155+
var quad = "";
156+
for (var i = zoom; i > 0; i--) {
157+
var mask = 1 << (i - 1);
158+
var cell = 0;
159+
if ((x & mask) != 0) cell++;
160+
if ((y & mask) != 0) cell += 2;
161+
quad += cell;
162+
}
163+
return quad;
164+
}
165+
154166
// map type list
155167
var maptypes = {
168+
bing_os: ['Ordnance Survey (UK)','Bing.com & Ordnance Survey', function(xy,z) { return 'http://ecn.t2.tiles.virtualearth.net/tiles/r'+makeQuad(xy.x, xy.y, z)+'?g=2689&lbl=l1&productSet=mmOS'; }],
156169
osm: ['OSM','OpenStreetMaps.org', function(xy,z) { return 'http://a.tile.openstreetmap.org/'+z+'/'+xy.x+'/'+xy.y+'.png'; }],
170+
osm_bw: ['OSM B&W','OSM Black & White', function(xy,z) { return 'http://a.www.toolserver.org/tiles/bw-mapnik/'+z+'/'+xy.x+'/'+xy.y+'.png'; }],
157171
osm_toner: ['OSM Toner','Stamen.org Toner', function(xy,z) { return 'http://a.tile.stamen.com/toner/'+z+'/'+xy.x+'/'+xy.y+'.png'; }],
158172
osm_watercolor: ['OSM Watercolor','Stamen.org Watercolor', function(xy,z) { return 'http://c.tile.stamen.com/watercolor/'+z+'/'+xy.x+'/'+xy.y+'.png'; }],
159-
osm_bw: ['OSM B&W','OSM Black & White', function(xy,z) { return 'http://a.www.toolserver.org/tiles/bw-mapnik/'+z+'/'+xy.x+'/'+xy.y+'.png'; }],
160173
}
161174

162175
// generate a list of names for the UI

0 commit comments

Comments
 (0)