Correcting getResolutionForZoom and getZoomForResolution in the fractional zoom case. Thanks Bart for catching the backwards logic, for the careful debugging, and for the great patch with tests. r=me (closes #1863)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@8516 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-12-18 17:03:44 +00:00
parent f4e616342c
commit 10d55cb523
2 changed files with 13 additions and 3 deletions

View File

@@ -952,7 +952,7 @@ OpenLayers.Layer = OpenLayers.Class({
if(this.map.fractionalZoom) {
var low = Math.floor(zoom);
var high = Math.ceil(zoom);
resolution = this.resolutions[high] +
resolution = this.resolutions[low] -
((zoom-low) * (this.resolutions[low]-this.resolutions[high]));
} else {
resolution = this.resolutions[Math.round(zoom)];
@@ -1000,7 +1000,7 @@ OpenLayers.Layer = OpenLayers.Class({
}
var dRes = highRes - lowRes;
if(dRes > 0) {
zoom = lowZoom + ((resolution - lowRes) / dRes);
zoom = lowZoom + ((highRes - resolution) / dRes);
} else {
zoom = lowZoom;
}