diff --git a/lib/OpenLayers/Layer/KaMap.js b/lib/OpenLayers/Layer/KaMap.js index 37291d6c57..2c8e00e2ea 100644 --- a/lib/OpenLayers/Layer/KaMap.js +++ b/lib/OpenLayers/Layer/KaMap.js @@ -42,11 +42,11 @@ OpenLayers.Layer.KaMap.prototype = var zoom = this.map.getZoom(); var maxRes = this.map.maxResolution; var mapRes = this.map.getResolution(); - var scale = (((this.tileSize.w * this.map.maxResolution * this.resolution) * (this.scales[this.units])) / this.tileSize.w) / Math.pow(2, zoom); + var scale = Math.round( (((this.tileSize.w * this.map.maxResolution * this.resolution) * (this.scales[this.units])) / this.tileSize.w) / Math.pow(2, zoom) * 10000 ) / 10000; var cellSize = new OpenLayers.Size(mapRes*this.tileSize.w, mapRes*this.tileSize.h); - var pX = Math.floor(((bounds.left) / cellSize.w) * this.tileSize.w); - var pY = -Math.floor(((bounds.top) / cellSize.h) * this.tileSize.h); + var pX = Math.round(((bounds.left) / cellSize.w) * this.tileSize.w); + var pY = -Math.round(((bounds.top) / cellSize.h) * this.tileSize.h); var url = this.getFullRequestString( { t: pY, l: pX,