2008/2/21 Leandro R <[EMAIL PROTECTED]>:
> The problem comes here: there is another function that removes all the
> markers and popups. The markers are correctly removed but the popups not.
> There is always one that is not removed. I have to run the function twice.

Your problem is that you have a counter i looping over an array while
you are removing stuff from it. The way I read it it will remove half
the popups each time.

You want a while loop, something like:

> function limpiarMapa() {
>     markerlyr.clearMarkers();
>     alert(map.popups.length);
>     while( map.popups.length ) {
>         map.removePopup(map.popups[0]);
>     }
>     alert(map.popups.length);
>  }

Have a nice day,
-- 
Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/
_______________________________________________
Dev mailing list
[email protected]
http://openlayers.org/mailman/listinfo/dev

Reply via email to