MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / tileUrlFunction

Method tileUrlFunction

src/openlayers/mapping/BaiduMap.js:59–81  ·  view source on GitHub ↗
(tileCoord, pixelRatio, projection)

Source from the content-addressed store, hash-verified

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 确认这个方法是否要开出去

Callers 2

ol.jsFile · 0.45

Calls 3

indexOfMethod · 0.80
toStringMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected