2013/5/10 Gery . <span dir="ltr"><<a href="mailto:gamejihou@hotmail.com" target="_blank">gamejihou@hotmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><font style="font-size:10pt" color="#366092" face="Arial"><br></font>Hi Raffaele,<br><br>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:<br>
</div></div></blockquote><div><br></div><div><br></div><div><div>the request being made is not really a problem</div><div><br></div><div>BTW but that conditional statement doesn't work here, event.feature.length is equal to 0 but nothing is being showed, chrome console shows that everything works on wms request, ie the response is correctly sent to the browser.</div>
</div><div><br></div><div>the problem is that event.features.length is always 0</div><div><br></div><div>code:</div><div><br></div><div><div> var info = new OpenLayers.Control.WMSGetFeatureInfo({</div><div> url: 'wmsserver',</div>
<div> title: 'Identify features by clicking',</div><div> queryVisible: true,</div><div> eventListeners: {</div><div> getfeatureinfo: function(event) {</div><div> var l = event.features.length;</div>
<div> alert(event.features.length+"-"+l)</div><div> if( event.features.length > 0 )</div><div> {</div><div> map.addPopup(new OpenLayers.Popup.FramedCloud(</div>
<div> "sostegno",</div><div> map.getLonLatFromPixel(event.xy),</div><div> null,</div><div> event.text,</div>
<div> null,</div><div> true</div><div> ));</div><div> }</div><div> }</div><div> }</div>
<div> });</div></div><div><br></div><div><br></div></div>