@@ -33,20 +33,20 @@ ol.reproj.TileFunctionType;
33
33
* @param {ol.tilegrid.TileGrid } sourceTileGrid Source tile grid.
34
34
* @param {ol.proj.Projection } targetProj Target projection.
35
35
* @param {ol.tilegrid.TileGrid } targetTileGrid Target tile grid.
36
- * @param {number } z Zoom level.
37
- * @param {number } x X.
38
- * @param {number } y Y.
36
+ * @param {ol.TileCoord } tileCoord Coordinate of the tile.
37
+ * @param {ol.TileCoord } wrappedTileCoord Coordinate of the tile wrapped in X.
39
38
* @param {number } pixelRatio Pixel ratio.
40
39
* @param {ol.reproj.TileFunctionType } getTileFunction
41
40
* Function returning source tiles (z, x, y, pixelRatio).
42
41
* @param {number= } opt_errorThreshold Acceptable reprojection error (in px).
43
42
* @param {boolean= } opt_renderEdges Render reprojection edges.
44
43
*/
45
44
ol . reproj . Tile = function ( sourceProj , sourceTileGrid ,
46
- targetProj , targetTileGrid , z , x , y , pixelRatio , getTileFunction ,
45
+ targetProj , targetTileGrid , tileCoord , wrappedTileCoord ,
46
+ pixelRatio , getTileFunction ,
47
47
opt_errorThreshold ,
48
48
opt_renderEdges ) {
49
- goog . base ( this , [ z , x , y ] , ol . TileState . IDLE ) ;
49
+ goog . base ( this , tileCoord , ol . TileState . IDLE ) ;
50
50
51
51
/**
52
52
* @private
@@ -84,6 +84,12 @@ ol.reproj.Tile = function(sourceProj, sourceTileGrid,
84
84
*/
85
85
this . targetTileGrid_ = targetTileGrid ;
86
86
87
+ /**
88
+ * @private
89
+ * @type {ol.TileCoord }
90
+ */
91
+ this . wrappedTileCoord_ = wrappedTileCoord ? wrappedTileCoord : tileCoord ;
92
+
87
93
/**
88
94
* @private
89
95
* @type {!Array.<ol.Tile> }
@@ -102,7 +108,7 @@ ol.reproj.Tile = function(sourceProj, sourceTileGrid,
102
108
*/
103
109
this . sourceZ_ = 0 ;
104
110
105
- var targetExtent = targetTileGrid . getTileCoordExtent ( this . getTileCoord ( ) ) ;
111
+ var targetExtent = targetTileGrid . getTileCoordExtent ( this . wrappedTileCoord_ ) ;
106
112
var maxTargetExtent = this . targetTileGrid_ . getExtent ( ) ;
107
113
var maxSourceExtent = this . sourceTileGrid_ . getExtent ( ) ;
108
114
@@ -126,7 +132,8 @@ ol.reproj.Tile = function(sourceProj, sourceTileGrid,
126
132
}
127
133
}
128
134
129
- var targetResolution = targetTileGrid . getResolution ( z ) ;
135
+ var targetResolution = targetTileGrid . getResolution (
136
+ this . wrappedTileCoord_ [ 0 ] ) ;
130
137
131
138
var targetCenter = ol . extent . getCenter ( limitedTargetExtent ) ;
132
139
var sourceResolution = ol . reproj . calculateSourceResolution (
@@ -248,15 +255,15 @@ ol.reproj.Tile.prototype.reproject_ = function() {
248
255
} , this ) ;
249
256
this . sourceTiles_ . length = 0 ;
250
257
251
- var tileCoord = this . getTileCoord ( ) ;
252
- var z = tileCoord [ 0 ] ;
258
+ var z = this . wrappedTileCoord_ [ 0 ] ;
253
259
var size = this . targetTileGrid_ . getTileSize ( z ) ;
254
260
var width = goog . isNumber ( size ) ? size : size [ 0 ] ;
255
261
var height = goog . isNumber ( size ) ? size : size [ 1 ] ;
256
262
var targetResolution = this . targetTileGrid_ . getResolution ( z ) ;
257
263
var sourceResolution = this . sourceTileGrid_ . getResolution ( this . sourceZ_ ) ;
258
264
259
- var targetExtent = this . targetTileGrid_ . getTileCoordExtent ( tileCoord ) ;
265
+ var targetExtent = this . targetTileGrid_ . getTileCoordExtent (
266
+ this . wrappedTileCoord_ ) ;
260
267
this . canvas_ = ol . reproj . render ( width , height , this . pixelRatio_ ,
261
268
sourceResolution , this . sourceTileGrid_ . getExtent ( ) ,
262
269
targetResolution , targetExtent , this . triangulation_ , sources ,
0 commit comments