And it helps if you do the order of operations right so that the figures
are not rounded to integers, really. git-svn-id: http://svn.openlayers.org/branches/openlayers/2.0@1342 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -49,7 +49,7 @@ OpenLayers.Layer.KaMap.prototype =
|
|||||||
*/
|
*/
|
||||||
getURL: function (bounds) {
|
getURL: function (bounds) {
|
||||||
var mapRes = this.map.getResolution();
|
var mapRes = this.map.getResolution();
|
||||||
var scale = Math.round((this.map.getScale() * 10000) / 10000);
|
var scale = Math.round((this.map.getScale() * 10000)) / 10000;
|
||||||
var cellSize = new OpenLayers.Size(mapRes*this.tileSize.w, mapRes*this.tileSize.h);
|
var cellSize = new OpenLayers.Size(mapRes*this.tileSize.w, mapRes*this.tileSize.h);
|
||||||
var pX = Math.round(((bounds.left) / cellSize.w) * this.tileSize.w);
|
var pX = Math.round(((bounds.left) / cellSize.w) * this.tileSize.w);
|
||||||
var pY = -Math.round(((bounds.top) / cellSize.h) * this.tileSize.h);
|
var pY = -Math.round(((bounds.top) / cellSize.h) * this.tileSize.h);
|
||||||
|
|||||||
Reference in New Issue
Block a user