Made use of mapzoomout+mapzoomin on all maptypes + simplified the client code of the individual maps.

This commit is contained in:
FrozenCow 2011-07-24 17:11:34 +02:00
parent f0a043b41c
commit 85a49eb934
4 changed files with 59 additions and 79 deletions

View file

@ -22,7 +22,17 @@ var HDMapType = DynmapTileLayer.extend({
this.projection = new HDProjection($.extend({map: this}, options));
},
getTileName: function(tilePoint, zoom) {
return namedReplace('{prefix}{nightday}/{scaledx}_{scaledy}/{zoom}{x}_{y}.png', this.getTileInfo(tilePoint, zoom));
var info = this.getTileInfo(tilePoint, zoom);
// Y is inverted for HD-map.
info.y = -info.y;
info.scaledy = info.y >> 5;
return namedReplace('{prefix}{nightday}/{scaledx}_{scaledy}/{zoom}{x}_{y}.png', info);
},
zoomprefix: function(amount) {
// amount == 0 -> ''
// amount == 1 -> 'z_'
// amount == 2 -> 'zz_'
return 'zzzzzzzzzzzzzzzzzzzzzz'.substr(0, amount) + (amount === 0 ? '' : '_');
}
});