source: binary-improvements/webserver_legacy/js/leaflet.layer.sdtdtiles.js@ 501

Last change on this file since 501 was 315, checked in by alloc, 7 years ago

Fixes

File size: 588 bytes
Line 
1function GetSdtdTileLayer (mapinfo, initTime, isMiniMap) {
2 if (typeof isMiniMap == 'undefined') isMiniMap = false;
3
4 var tileLayer = L.tileLayer('../map/{z}/{x}/{y}.png?t={time}', {
5 maxZoom: isMiniMap ? mapinfo.maxzoom : mapinfo.maxzoom + 1,
6 minZoom: isMiniMap ? -1 : Math.max(0, mapinfo.maxzoom - 5),
7 maxNativeZoom: mapinfo.maxzoom,
8 minNativeZoom: 0,
9 tileSize: mapinfo.tilesize,
10 time: initTime
11 });
12
13 tileLayer.getTileUrl = function (coords) {
14 coords.y = (-coords.y) - 1;
15 return L.TileLayer.prototype.getTileUrl.bind (tileLayer) (coords);
16 };
17
18
19 return tileLayer;
20}
21
Note: See TracBrowser for help on using the repository browser.