[OpenLayers-Dev] Zoom Problems Switching Baselayers -- HELP!

Gianni Barrotta giannibarrotta at gmail.com
Fri Oct 5 17:24:18 EDT 2007


I had a similar problem and solved it by passing the maxExtent to options of
my layers and setting the tileOrigin before switching the layer.
It's quite weird, I suppose the problem is that you don't call this method:

   /** When the layer is added to a map, then we can fetch our origin
     *  (if we don't have one.)
     *
     * @param {OpenLayers.Map} map
     */
    setMap: function(map) {
        OpenLayers.Layer.Grid.prototype.setMap.apply(this, arguments);
        if (!this.tileOrigin) {
            this.tileOrigin = new OpenLayers.LonLat(this.map.maxExtent.left,
                                                this.map.maxExtent.bottom);
        }
    },

when you switch the layer, and so the tile origin is not updated...but I
don't know if this could be the right fix.



On 10/4/07, Erik Uzureau <erik.uzureau at metacarta.com> wrote:
>
> Hi Arnd,
>
> Thanks for sending this test code... can you explain what we should
> test for, though?
>
> ie how do we know if our patch has fixed the problem for you?
>
> Erik
>
> On 10/3/07, Arnd Wippermann <arnd.wippermann at web.de> wrote:
> > And the file
> >
> > Mit freundlichen Grüssen
> >
> > Arnd Wippermann
> > http://gis.ibbeck.de/ginfo/
> >
> >
> > _______________________________________________
> > Dev mailing list
> > Dev at openlayers.org
> > http://openlayers.org/mailman/listinfo/dev
> >
> >
> >
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20071005/bc402dbe/attachment.html


More information about the Dev mailing list