Re-use ol.TileCoord objects
This commit is contained in:
@@ -113,6 +113,7 @@ ol.source.WMTS = function(options) {
|
||||
}));
|
||||
}
|
||||
|
||||
var tmpTileCoord = new ol.TileCoord(0, 0, 0);
|
||||
tileUrlFunction = ol.TileUrlFunction.withTileCoordTransform(
|
||||
function(tileCoord, projection) {
|
||||
var tileGrid = this.getTileGrid();
|
||||
@@ -134,8 +135,10 @@ ol.source.WMTS = function(options) {
|
||||
(extent.maxX - extent.minX) /
|
||||
(tileExtent.maxX - tileExtent.minX));
|
||||
x = goog.math.modulo(x, numCols);
|
||||
tileExtent = tileGrid.getTileCoordExtent(
|
||||
new ol.TileCoord(tileCoord.z, x, tileCoord.y));
|
||||
tmpTileCoord.z = tileCoord.z;
|
||||
tmpTileCoord.x = x;
|
||||
tmpTileCoord.y = tileCoord.y;
|
||||
tileExtent = tileGrid.getTileCoordExtent(tmpTileCoord);
|
||||
}
|
||||
if (!tileExtent.intersects(extent)) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user