<div dir="ltr">Hi Gery,<div><br></div><div style>The execution never get that far. Featureselected is not triggered.</div><div style>Problem is in the request method of GetFeature class or actually much deeper but that httprequest code gets too complex for me to understand.</div>
<div style><br></div>In the request method of GetFeature class result.features.length is 0 so it never selects anything.<div><div><br><div><i>Request method of GetFeature class:</i><br><div style><div class="" style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre">
<span class="" style>callback</span>: <span class="" style>function</span>(<span class="" style>result</span>) {</div><div class="" style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre">
<span class="" style>if</span>(<span class="" style>result</span>.<span class="" style>success</span>()) {</div><div class="" style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre">
if(result.features.length) {</div><div class="" style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre"> if(options.single == true) {</div>
<div class="" style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre"> this.selectBestFeature(result.features,</div><div class="" style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre">
bounds.getCenterLonLat(), options);</div><div class="" style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre"> } else {</div>
<div class="" style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre"> this.select(result.features);</div><div class="" style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre">
}</div></div><div style><br></div></div></div><div style>-Lauri</div><div style><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 20, 2013 at 12:35 AM, Gery . <span dir="ltr"><<a href="mailto:gamejihou@hotmail.com" target="_blank">gamejihou@hotmail.com</a>></span> wrote:<br>
<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">perhaps<font style="font-size:10pt"> us<font style="font-size:10pt">ing some<font style="font-size:10pt">:<br><br></font>console.log("WHAT IT IS GO<font style="font-size:10pt">ING <font style="font-size:10pt">ON </font>WITH": <font style="font-size:10pt">feat);</font></font></font></font></font><br>
<font style="font-size:10pt" color="#366092" face="Arial"><font style="font-size:10pt" color="#366092" face="Arial"><font style="font-size:10pt"><font style="font-size:10pt">console.log("WHAT IT IS GO<font style="font-size:10pt">ING <font style="font-size:10pt">ON </font>WITH": <font style="font-size:10pt">bbox);</font></font></font></font></font></font><br>
<font style="font-size:10pt" color="#366092" face="Arial"><font style="font-size:10pt"><font style="font-size:10pt">console.log("WHAT IT IS GO<font style="font-size:10pt">ING <font style="font-size:10pt">ON </font>WITH": <font style="font-size:10pt">center);<br>
<br><font style="font-size:10pt">can <font style="font-size:10pt">help <font style="font-size:10pt">you to <font style="font-size:10pt">find <font style="font-size:10pt">the error.</font></font></font></font></font></font></font></font></font></font><br>
<font style="font-size:10pt" color="#1F497D" face="Arial"><br>__________________________________________________________________________________________<br>Piensa en el medio ambie<font face="Arial">nte - mantenlo en la pantalla. NO lo imprimas si NO es necesario.</font></font><font style="font-size:10pt" color="#1F497D" face="Arial"><br>
</font><font style="font-size:10pt" color="#1F497D" face="Arial">Think green - keep it on the screen. Do NOT print if it is NOT necessary.</font><font style="font-size:10pt" color="#1F497D" face="Arial"><br></font><font style="font-size:10pt" color="#1F497D" face="Arial"><span lang="de"><span>Denken Sie an</span> <span>die Umwelt</span></span></font><font style="font-size:10pt" color="#1F497D" face="Arial"><span lang="de"><span></span> <span>-</span> <span>bewahren Sie es</span> <span>auf dem Bildschirm.</span> <span>Drucken Sie es NICHT</span><span>, wenn</span> <span>es NICHT notwendig ist</span><span>.</span></span></font><br>
<br><br><div><div></div><hr>Date: Wed, 20 Feb 2013 00:31:15 +0200<br>From: <a href="mailto:lauri.kajan@gmail.com" target="_blank">lauri.kajan@gmail.com</a><br>To: <a href="mailto:openlayers-users@lists.osgeo.org" target="_blank">openlayers-users@lists.osgeo.org</a><br>
Subject: [OpenLayers-Users] GetFeature with WFS protocol doesn't return features<div><div class="h5"><br><br><div dir="ltr">Hello,<div><br></div><div>When I'm trying to use GetFeature control to get features from my WFS run into problems. The "featureselected" event never gets triggered.</div>
<div>I debugged it little bit and found out that the wfs request itself return a valid gml and the status code of the request is 200. But still the features array of the result object is empty so the code never gets to the select method of the GetFeature class.</div>
<div><br></div><div>Is this something to do with a proxy that I have set?</div><div>I have set OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";</div><div><br></div><div>I have configured GetFeature control as follows:</div>
<div><br></div><div><div> var select = new OpenLayers.Control.GetFeature({</div><div> protocol: OpenLayers.Protocol.WFS({</div><div> url: "**:8080/geoserver/wfs",</div><div>
featureType: "**",</div><div> featureNS: "**",</div><div> geometryName: "geom"</div><div> }),</div><div> click: true,</div>
<div> clickTolerance: 1,</div><div> single: true,</div><div> hover: false </div><div> });</div><div> select.events.register("featureselected", this, function(e) {</div>
<div> var feat = e.feature;</div><div> var bbox = feat.geometry.bounds; </div><div> var center = bbox.getCenterLonLat(); </div><div> map.panTo(center); </div><div> });</div><div><br></div><div>
<br></div><div>I would appreciate all the help</div><div>Thanks</div><div><br></div><div><br></div><div>-Lauri</div></div></div>
<br></div></div>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a></div> </div></div>
</blockquote></div><br></div>