[OpenLayers-Dev] FixedZoomLevels

Eric Lemoine eric.c2c at gmail.com
Sun Nov 4 05:24:07 EST 2007


Hi Sébastien,

I guess your report hasn't received the attention it deserves :-) I
think you have found a bug, I opened a ticket for this, and assigned
it to me.

<http://trac.openlayers.org/ticket/1124>

--
Eric


On 10/30/07, Sébastien Roch <roch.sebastien at gmail.com> wrote:
> 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];
>             }
> }
>
> And this works for me. Can anyone tell me if this is right ?
> if not, I'll post my code with my layers, maybe I'm wrong with something.
> Thanks
>
> Sebastien
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>


More information about the Dev mailing list