@Eric Lemoine <br><br>Eric, just go the examples page <a href="http://www.openlayers.org/dev/examples/">http://www.openlayers.org/dev/examples/</a> <br>and type &quot;feature info in popup&quot;. It&#39;s the first one that appears.<br>
<br>@Ziegler Stefan<br><br>Thanks for your suggestion.<br><br>I ended up solving it in a similar way.<br><br>Here&#39;s my previous code:<br><br>var info = new OpenLayers.Control.WMSGetFeatureInfo({<br>            url: &quot;<a href="http://127.0.0.1:8081/cgi-bin/mapserv.exe?map=c">http://127.0.0.1:8081/cgi-bin/mapserv.exe?map=c</a>:\\maps\\wms_postgis.map&quot;,<br>
            title: &#39;Identify features by clicking&#39;,<br>            queryVisible: true,<br>            vendorParams: {<br>            &quot;FEATURE_COUNT&quot;: &quot;1000&quot;},<br>            eventListeners: {<br>
                getfeatureinfo:<br>                    function(event) {<br>                        map.addPopup(new OpenLayers.Popup.FramedCloud(<br>                            &quot;chicken&quot;,<br>                            map.getLonLatFromPixel(event.xy),<br>
                            null,<br>                            event.text,<br>                            null,<br>                            true<br>                        ));<br>                }<br>            }<br>
        });<br>        map.addControl(info);<br>        info.activate();<br><br>and here&#39;s how I solved it:<br><br>var info = new OpenLayers.Control.WMSGetFeatureInfo({<br>            url: &quot;<a href="http://127.0.0.1:8081/cgi-bin/mapserv.exe?map=c">http://127.0.0.1:8081/cgi-bin/mapserv.exe?map=c</a>:\\maps\\wms_postgis.map&quot;,<br>
            title: &#39;Identify features by clicking&#39;,<br>            queryVisible: true,<br>            vendorParams: {<br>            &quot;FEATURE_COUNT&quot;: &quot;1000&quot;},<br>            eventListeners: {<br>
                getfeatureinfo:<br>                    function(event) {<br>                     if((event.text).length != 1) {<br>                        map.addPopup(new OpenLayers.Popup.FramedCloud(<br>                            &quot;chicken&quot;,<br>
                            map.getLonLatFromPixel(event.xy),<br>                            null,<br>                            event.text,<br>                            null,<br>                            true<br>                        ));<br>
                    }<br>                }<br>            }<br>        });<br>        map.addControl(info);<br>        info.activate();<br><br><br>Just an &quot;if&quot; solved. <br>Simpler than I expected :-P<br><br>thank you two!!<br>
<br>Marcos<br><br><br><div class="gmail_quote">On Wed, Aug 26, 2009 at 3:14 AM, Ziegler Stefan <span dir="ltr">&lt;<a href="mailto:Stefan.Ziegler@bd.so.ch">Stefan.Ziegler@bd.so.ch</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Marcos<br>
<br>
my - not very sophisticated - approach:<br>
<br>
        function setHTML(response) {<br>
                if (response.responseText.indexOf(&#39;&lt;body&gt;  &lt;/body&gt;&#39;) == -1) {<br>
                        // show popup....<br>
                }<br>
                else {<br>
                        // do not show popup...<br>
                }<br>
        }<br>
It simply checks wether the returned html stuff consists only of two body tags. Probably you have to change the check string according to your wms server&#39;s empty response.<br>
<br>
regards<br>
Stefan<br>
<br>
<br>
<br>
<br>
<br>
----- Originalnachricht -----<br>
Von: Marcos Nogueira &lt;<a href="mailto:nomarcos@gmail.com">nomarcos@gmail.com</a>&gt;<br>
Gesendet: Die, 25.8.2009 21:17<br>
An: <a href="mailto:users@openlayers.org">users@openlayers.org</a><br>
Betreff: [OpenLayers-Users] Popups doubt in example &quot;Feature Info in Popup&quot;<br>
<div class="im"><br>
Hi,<br>
<br>
I managed to use GetFeatureInfo perfectly in my application after checking the example &quot;Feature Info in Popup&quot;.<br>
<br>
Every point that I click that has some information to be returned gets it returned. It&#39;s great.<br>
<br>
<br>
But the problem is, when I click in a place in the map that has no information, I mean, a point from my WMS layer that has no<br>
information about it in my source, it returns an empty popup.<br>
That behaviour also happens in the example. If you click in the white area, for example, it returns you an empty popup.<br>
<br>
<br>
The question I have is:<br>
how do I make for the popup to appear only when there&#39;s some information being returned ??<br>
<br>
I&#39;m using openlayers 2.8<br>
<br>
</div><div class="im">Thanks for the attention guys<br>
<br>
Marcos<br>
<br>
<br>
<br>
<br>
<br>
--<br>
&quot;Saber o que é certo e não fazê-lo é a pior covardia.&quot;<br>
<br>
<br>
</div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>&quot;Saber o que é certo e não fazê-lo é a pior covardia.&quot;<br><br>