[OpenLayers-Users] WFSGetFeatureInfo and OpenLayers.Popup.FramedCloud

Gery . gamejihou at hotmail.com
Fri May 10 06:32:51 PDT 2013


Hi Raffaele,

I think the WMS request is always sent. One idea could be that you add some if/else inside the current if loop or elseif to prevent sending the request, something like:

getfeatureinfo: function(event) {                if(event.features.length > 0) {if (url =! "something") {//statement here to prevent to be sent}else
                        map.addPopup(new OpenLayers.Popup.FramedCloud(                            "sostegno",                            map.getLonLatFromPixel(event.xy),                            null,                            event.text,                            null,                            true                        ));                    }                }            }
the above is untested, it's just one idea about it. Perhaps googling around will help you to find some more ideas, try in stackoverflow.com.

Hope this helps,

Gery

__________________________________________________________________________________________
Piensa en el medio ambiente - mantenlo en la pantalla. NO lo imprimas si NO es necesario.
Think green - keep it on the screen. Do NOT print if it is NOT necessary.
Denken Sie an die Umwelt - bewahren Sie es auf dem Bildschirm. Drucken Sie es NICHT, wenn es NICHT notwendig ist.


From: jawendell at suddenlink.net
To: raffaele.morelli at gmail.com; openlayers-users at lists.osgeo.org
Date: Fri, 10 May 2013 09:21:12 -0400
Subject: Re: [OpenLayers-Users] WFSGetFeatureInfo	and	OpenLayers.Popup.FramedCloud

Raffaele, That is the way I prevent the popup from showing up when there are not any features.  I am not sure how to prevent the getfeatureinfo request from being made in that situation.  Someone with more experience than myself will need to address that issue. Jerome  From: openlayers-users-bounces at lists.osgeo.org [mailto:openlayers-users-bounces at lists.osgeo.org] On Behalf Of Raffaele Morelli
Sent: Friday, May 10, 2013 9:10 AM
To: openlayers-users at lists.osgeo.org
Subject: Re: [OpenLayers-Users] WFSGetFeatureInfo and OpenLayers.Popup.FramedCloud It helps but the WMS request is sent anyway, but apart from that it doesn't workevent.features.length=0 but the popup doesn't show up Here is my code snippet getfeatureinfo: function(event) {                if(event.features.length > 0) {                        map.addPopup(new OpenLayers.Popup.FramedCloud(                            "sostegno",                            map.getLonLatFromPixel(event.xy),                            null,                            event.text,                            null,                            true                        ));                    }                }            }  
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130510/f108e0bf/attachment.html>


More information about the Users mailing list