OpenLayers HowTo Close popup

I’m using Popups on top of OpenStreetMap - works well
but the user has to click the close box of the popup to close it
(then after getting the close click event I’m removing also the Popup component from the map)

there are situations where I want to close and remove popup’s from the map without user-interaction,
but removing the (Popup) component from the map doesn’t close the Popup

any idea how to close and remove Popups programatically ?

thx

ekke

Hi,

removeComponent should do it, but I gotta admit that I have never done that by myself and there might be a but. I just worked very briefly on the project and through in a patch that might help.

A snapshot build is downloadable from the project page:
http://code.google.com/p/vopenlayers/

cheers,
matti

unfortunately removing the component doesn’t close the Popup.

I’m using 0.9.1 version

sorry not contributing a patch - I’m more the java-server-side-business-app-developer :wink:

Hi,

Could you try with the build on the project pages …SNAPSHOT-r100.jar or something. That should have it fixed. Haven’t released a version to Directory yet as I haven’t tested some new features/fixes enough.

cheers,
matti

THX Matti,

using r100 snapshot:

if removing a Popup Component from the Map, then the Popup was also closed

now it works as expected

ekke