Do not load tiles outside extents for TileWMS source

This commit is contained in:
Ivan Grcic
2014-02-14 07:52:43 +01:00
committed by Ivan Grcic
parent e0b8e6005c
commit 34d5f24816

View File

@@ -346,6 +346,13 @@ ol.source.TileWMS.prototype.tileUrlFunction_ =
tileExtent = ol.extent.buffer(tileExtent,
tileResolution * gutter, tileExtent);
}
var extent = this.getExtent();
if (!goog.isNull(extent) && (!ol.extent.intersects(tileExtent, extent) ||
ol.extent.touches(tileExtent, extent))) {
return undefined;
}
if (pixelRatio != 1) {
tileSize = (tileSize * pixelRatio + 0.5) | 0;
}