Rev | Line | |
---|
[249] | 1 | function 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,
|
---|
[315] | 6 | minZoom: isMiniMap ? -1 : Math.max(0, mapinfo.maxzoom - 5),
|
---|
[249] | 7 | maxNativeZoom: mapinfo.maxzoom,
|
---|
[315] | 8 | minNativeZoom: 0,
|
---|
[249] | 9 | tileSize: mapinfo.tilesize,
|
---|
| 10 | time: initTime
|
---|
| 11 | });
|
---|
| 12 |
|
---|
[315] | 13 | tileLayer.getTileUrl = function (coords) {
|
---|
| 14 | coords.y = (-coords.y) - 1;
|
---|
| 15 | return L.TileLayer.prototype.getTileUrl.bind (tileLayer) (coords);
|
---|
[249] | 16 | };
|
---|
[315] | 17 |
|
---|
[249] | 18 |
|
---|
| 19 | return tileLayer;
|
---|
| 20 | }
|
---|
| 21 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.