TMS layer needs to round x and y in TMS url. Patch by Paul Spencer, Review by

Tim. (Closes #913.)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@4037 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-08-24 23:49:06 +00:00
parent 0d2f10ad5c
commit 42e4f72a9f
2 changed files with 12 additions and 2 deletions

View File

@@ -94,8 +94,8 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
getURL: function (bounds) {
bounds = this.adjustBounds(bounds);
var res = this.map.getResolution();
var x = (bounds.left - this.tileOrigin.lon) / (res * this.tileSize.w);
var y = (bounds.bottom - this.tileOrigin.lat) / (res * this.tileSize.h);
var x = Math.round((bounds.left - this.tileOrigin.lon) / (res * this.tileSize.w));
var y = Math.round((bounds.bottom - this.tileOrigin.lat) / (res * this.tileSize.h));
var z = this.map.getZoom();
var path = "1.0.0" + "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type;
var url = this.url;