On Tue, Aug 5, 2008 at 11:49 AM, Simone Gadenz <[EMAIL PROTECTED]> wrote:
> Hello!
>
>
>
> I have a layer of vector geocoded features that I want to be clean when the
> users click on a button.
>
> The features react to the user interaction opening a popup managed by the
> SelectFeatures control.
>
>
>
> I manage to remove all the feature from the map using a very simple function
> like this:
>
>
>
> function clearData(layer){
>
>       layer.destroyFeatures();
>
> }
>
>
>
> The problem is if one popup is open when the functio is called. In that case
> the popup is not destroyed.
>
>
>
> Is there a way of removing all the popups?

There's nothing in the API. But you can do it with this:

for (var i = map.popups.length - 1; i >= 0; --i) {
    map.removePopup(map.popups[i]);
}

--
Eric

--
Eric
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to