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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user