KaMap can't round. It works fine for degrees, but when you're working in inches, feet, meters, the rounding errors become quite significant.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@802 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-06-27 20:17:37 +00:00
parent 6abc62718c
commit c20390c864

View File

@@ -42,7 +42,7 @@ OpenLayers.Layer.KaMap.prototype =
var zoom = this.map.getZoom(); var zoom = this.map.getZoom();
var maxRes = this.map.maxResolution; var maxRes = this.map.maxResolution;
var mapRes = this.map.getResolution(); var mapRes = this.map.getResolution();
var scale = Math.round((((this.tileSize.w * this.map.maxResolution * this.resolution) * (this.scales[this.units])) / this.tileSize.w) / Math.pow(2, zoom)); var scale = (((this.tileSize.w * this.map.maxResolution * this.resolution) * (this.scales[this.units])) / this.tileSize.w) / Math.pow(2, zoom);
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.floor(((bounds.left) / cellSize.w) * this.tileSize.w); var pX = Math.floor(((bounds.left) / cellSize.w) * this.tileSize.w);