[OpenLayers-Dev] Bug Report about Popups in map.js

Erik Uzureau erik.uzureau at metacarta.com
Thu Nov 15 09:56:02 EST 2007


Great Find! And great patch!

Thanks guys for taking care of this. I've applied the patch to trunk.

--Erik


On 11/15/07, Frédéric Junod <frederic.junod at camptocamp.com> wrote:
> Le Thu, 15 Nov 2007 14:18:58 +0800,
> "li ethan" <ethan919 at gmail.com> a écrit :
>
> > Dear listers!
> >     Did anyone notice there might be a bug at addPopup:
> > function(popup, exclusive) in Map.js.
> > this method first remove all the popups when the exclusive flag is
> > true,and I think there is a problem is this statements
> >             for(var i=0; i < this.popups.length; i++) {
> >                 this.removePopup(this.popups[i]);
> >             }
> >
> > and the removePopup method use array.splice(i,1) to cut off the
> > array,there might have some elements in this array never get
> > removed,like the element in index 1 will not be removed because it be
> > shift to index 0 after first loop.Am I correct?
>
> You're correct ...
>
> The loop should be:
>
>     for (var i = this.popups.length - 1; i >= 0; --i) {
>        this.removePopup(this.popups[i]);
>     }
>
> I've opened a ticket for that, http://trac.openlayers.org/ticket/1149
>
> Regards,
>
> fredj
>
> --
> Frédéric Junod
> Camptocamp SA
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>



More information about the Dev mailing list