[OpenLayers-Users] Popups doubt in example "Feature Info in Popup"

Ziegler Stefan Stefan.Ziegler at bd.so.ch
Wed Aug 26 02:14:30 EDT 2009


Hi Marcos

my - not very sophisticated - approach: 

	function setHTML(response) {
		if (response.responseText.indexOf('<body>  </body>') == -1) {
			// show popup....
		}
		else {
			// do not show popup...
		}
	}
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's empty response.

regards
Stefan





----- Originalnachricht -----
Von: Marcos Nogueira <nomarcos at gmail.com>
Gesendet: Die, 25.8.2009 21:17
An: users at openlayers.org
Betreff: [OpenLayers-Users] Popups doubt in example "Feature Info in Popup"

Hi,

I managed to use GetFeatureInfo perfectly in my application after checking the example "Feature Info in Popup".

Every point that I click that has some information to be returned gets it returned. It's great.


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 
information about it in my source, it returns an empty popup.
That behaviour also happens in the example. If you click in the white area, for example, it returns you an empty popup.


The question I have is:
how do I make for the popup to appear only when there's some information being returned ??

I'm using openlayers 2.8 

Thanks for the attention guys

Marcos 





-- 
"Saber o que é certo e não fazê-lo é a pior covardia."


_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users



More information about the Users mailing list