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: jawend...@suddenlink.net
To: raffaele.more...@gmail.com; openlayers-users@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-boun...@lists.osgeo.org 
[mailto:openlayers-users-boun...@lists.osgeo.org] On Behalf Of Raffaele Morelli
Sent: Friday, May 10, 2013 9:10 AM
To: openlayers-users@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
us...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users                        
                  
_______________________________________________
Users mailing list
us...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to