diff --git a/lib/OpenLayers/Layer/TileCache.js b/lib/OpenLayers/Layer/TileCache.js index c20bffbaf6..ed9906fcab 100644 --- a/lib/OpenLayers/Layer/TileCache.js +++ b/lib/OpenLayers/Layer/TileCache.js @@ -103,8 +103,8 @@ OpenLayers.Layer.TileCache = OpenLayers.Class(OpenLayers.Layer.Grid, { var res = this.map.getResolution(); var bbox = this.maxExtent; var size = this.tileSize; - var tileX = Math.floor((bounds.left - bbox.left) / (res * size.w)); - var tileY = Math.floor((bounds.bottom - bbox.bottom) / (res * size.h)); + var tileX = Math.round((bounds.left - bbox.left) / (res * size.w)); + var tileY = Math.round((bounds.bottom - bbox.bottom) / (res * size.h)); var tileZ = this.map.zoom; /** * Zero-pad a positive integer.