2011-07-16 23:53:15 +02:00
|
|
|
var FlatProjection = DynmapProjection.extend({
|
|
|
|
fromLocationToLatLng: function(location) {
|
2011-07-24 17:11:34 +02:00
|
|
|
return new L.LatLng(
|
2011-07-27 17:07:28 +02:00
|
|
|
-location.z / (1 << this.options.mapzoomout),
|
|
|
|
location.x / (1 << this.options.mapzoomout),
|
2011-07-24 17:11:34 +02:00
|
|
|
true);
|
2011-07-16 23:53:15 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
var FlatMapType = DynmapTileLayer.extend({
|
|
|
|
options: {
|
|
|
|
minZoom: 0,
|
|
|
|
maxZoom: 4
|
|
|
|
},
|
|
|
|
initialize: function(options) {
|
2011-07-24 17:11:34 +02:00
|
|
|
options.maxzoomout = options.mapzoomout || options.world.extrazoomout;
|
|
|
|
options.maxZoom = options.mapzoomin + options.maxzoomout;
|
2011-07-16 23:53:15 +02:00
|
|
|
L.Util.setOptions(this, options);
|
2011-07-24 17:11:34 +02:00
|
|
|
this.projection = new FlatProjection({mapzoomout: options.mapzoomout});
|
2011-07-16 23:53:15 +02:00
|
|
|
},
|
|
|
|
getTileName: function(tilePoint, zoom) {
|
2011-07-24 17:11:34 +02:00
|
|
|
return namedReplace(this.options.bigmap
|
|
|
|
? '{prefix}{nightday}_128/{scaledx}_{scaledy}/{zoom}_{x}_{y}.png'
|
|
|
|
: '{zoom}{prefix}{nightday}_128_{x}_{y}.png'
|
|
|
|
, this.getTileInfo(tilePoint, zoom));
|
2011-07-16 23:53:15 +02:00
|
|
|
}
|
2011-07-18 03:40:24 +02:00
|
|
|
});
|
2011-03-01 01:59:33 +01:00
|
|
|
|
2011-07-16 23:53:15 +02:00
|
|
|
maptypes.FlatMapType = function(options) { return new FlatMapType(options); };
|