[OpenLayers-Users] Removing popups with clicks on map

Alexandre Leroux alexandre.leroux at ec.gc.ca
Fri Feb 2 10:39:02 EST 2007


Hi list,

I'm using OpenLayers.Layer.Text to plot some markers. I'd like popups to 
disappear when a click on the map is done. Right now, the popup 
disappear only if (1) another markers is selected and a new popup first 
this second marker is shown, or if (2) the marker is clicked again. This 
is not convenient to me.

I looked at the popups.html example provided. I simply added the destroy 
popup code.

In my map div I added:
<div id="map" onclick="destroy()"></div>

and in my script section:
function destroy() {
            popup.destroy();
        }

But it does not work. Any idea why? It there another way to remove 
popups on clicks? Should I open a ticket?

Thanks & have a great Friday!

Alex :-)

-- 
Alexandre Leroux, M.Sc., Ing.
Environnement Canada / Environment Canada
Centre météorologique canadien / Canadian Meteorological Centre
Division de la réponse aux urgences environnementales /
Environmental Emergency Response Division
alexandre.leroux at ec.gc.ca




More information about the Users mailing list