Hi,<br>I did not understand this as I cannot find &quot;Moveend&quot; as a defined event. Or maybe I am missing something.<br>I have the following function under to define the popup box. I tried to write the checkPopup function without success:<br>
<br>            // popup box<br>          selectControl = new OpenLayers.Control.SelectFeature(map.layers[5],{onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});<br>           map.addControl(selectControl);<br>           selectControl.activate();<br>
           <br>           function onPopupClose(evt) {<br>                selectControl.unselect(selectedFeature);<br>            }<br><br>        function onFeatureSelect(feature) {<br>            selectedFeature = feature;<br>
            popup = new OpenLayers.Popup.FramedCloud(&quot;chicken&quot;, <br>                                     feature.geometry.getBounds().getCenterLonLat(),<br>                                     new OpenLayers.Size(100,200),<br>
                    &quot;&lt;h2&gt;&quot; +feature.attributes.gardsnavn + <br>                    &quot;&lt;/h2&gt;Type: &quot;+ feature.attributes.art +<br>                     &quot;&lt;br /&gt;Kommune: &quot;+ feature.attributes.komm +<br>
                     &quot;&lt;br /&gt;Beskrivelse&lt;br /&gt;&lt;a href=&#39;&quot; + feature.attributes.urltilpdfark + <br>                     &quot;&#39; target=blank&gt;&lt;img src=&#39;<a href="http://naturkart.no:8080/geoserver/images/logo.png">http://naturkart.no:8080/geoserver/images/logo.png</a>&#39; border=&#39;0&#39; alt=&#39;naturkart&#39;&gt;&lt;/a&gt;&quot;, null, true, onPopupClose);<br>
            feature.popup = popup;<br>            map.addPopup(popup);<br>        }<br>        function onFeatureUnselect(feature) {<br>            map.removePopup(feature.popup);<br>            feature.popup.destroy();<br>
            feature.popup = null;<br>        }        <br>        function checkPopup(feature) {<br>            if (feature.popup!= null){<br>            feature.popup.destroy();<br>            }<br>        }<br>        <br>
        map.events.register(&quot;moveend&quot;, map, checkPopup);<br><br><br>/asle<br><br><div class="gmail_quote">2009/6/4 Alexandre Dube <span dir="ltr">&lt;<a href="mailto:adube@mapgears.com">adube@mapgears.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
Register a &quot;moveend&quot; event to your map objet :<br>
<br>
yourMapObj.events.register(&quot;moveend&quot;, yourMapObj, checkPopup)<br>
<br>
Then, in your checkPopup function, check your map if it has any popup and destroy them.<br>
<br>
Regards,<br>
<br>
Alexandre<br>
<br>
Asle Benoni wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
Hello,<br>
I have some popups from a WFS layer and a KML layer . When I click the  point the popup shows. If I zoom in or out without closing the popup  the popup stays and I cannot close it. Is there a way to automatically  close any popups that are open when zooming in or out?<br>

<br>
Thanks for any help!<br>
<br>
/asle<br></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org" target="_blank">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
  <br>
</blockquote>
<br>
<br>
-- <br>
Alexandre Dubé<br>
Mapgears<br>
<a href="http://www.mapgears.com" target="_blank">www.mapgears.com</a><br>
<br>
</blockquote></div><br>