[OpenLayers-Trac] [OpenLayers] #1124: FixedZoomLevels.js doesn't properly set the resolutions array
OpenLayers
trac at openlayers.org
Sun Nov 4 04:48:41 EST 2007
#1124: FixedZoomLevels.js doesn't properly set the resolutions array
-----------------------------------+----------------------------------------
Reporter: elemoine | Owner: elemoine
Type: feature | Status: new
Priority: major | Milestone: 2.6 Release
Component: Layer.FixedZoomLevels | Version: 2.5
Keywords: |
-----------------------------------+----------------------------------------
Reported by Sébastien Roch:
{{{
Hi Dev,
I had a problem with some Google Layers in my map : I had some layers
with min and maxScale above a google layer (the baselayer). At first
it worked well, but after having zoomed 3 times, the layers don't
appear anymore (the google one is ok)
If at this moment I eval in the console "map.getScale()", it returns "NaN"
I found that the resolutions array of the google layer was not
properly set : this is done in FixedZoomLevels.js, in the
"initResolutions" function :
if (this.RESOLUTIONS != null) {
var resolutionsIndex = 0;
this.resolutions = [];
for(var i= this.minZoomLevel; i < this.numZoomLevels; i++) {
this.resolutions[resolutionsIndex++] = this.RESOLUTIONS[i];
}
}
I changed this part with :
if (this.RESOLUTIONS != null) {
var resolutionsIndex = 0;
this.resolutions = [];
for(var i= this.minZoomLevel; i <= this.maxZoomLevel; i++)
{ // HERE
this.resolutions[resolutionsIndex++] = this.RESOLUTIONS[i];
}
}
}}}
--
Ticket URL: <http://trac.openlayers.org/ticket/1124>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list