(tileCoord, pixelRatio, projection)
| 57 | |
| 58 | // eslint-disable-next-line no-unused-vars |
| 59 | function tileUrlFunction(tileCoord, pixelRatio, projection) { |
| 60 | var tempUrl = url |
| 61 | .replace('{num}', Math.abs((tileCoord[1] + tileCoord[2]) % 4)) |
| 62 | .replace('{z}', tileCoord[0].toString()) |
| 63 | .replace('{x}', tileCoord[1].toString()) |
| 64 | .replace('{y}', function() { |
| 65 | var y = ['4', '5'].indexOf(Util.getOlVersion()) > -1 ? tileCoord[2] : -tileCoord[2] - 1; |
| 66 | return y.toString(); |
| 67 | }) |
| 68 | .replace('{-y}', function() { |
| 69 | var z = tileCoord[0]; |
| 70 | var range = tileGrid.getFullTileRange(z); |
| 71 | asserts.assert(range, 55); // The {-y} placeholder requires a tile grid with extent |
| 72 | var y = range.getHeight() + tileCoord[2]; |
| 73 | return y.toString(); |
| 74 | }); |
| 75 | |
| 76 | //支持代理 |
| 77 | if (me.tileProxy) { |
| 78 | tempUrl = me.tileProxy + encodeURIComponent(tempUrl); |
| 79 | } |
| 80 | return tempUrl; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | // TODO 确认这个方法是否要开出去 |
no test coverage detected