<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font style="font-size:10pt;" color="#366092" face="Arial" size="2">Hi Lauri,<br><br><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2">not sure but the problem can be related to how the feat<font style="font-size: 10pt;" size="2">ures a<font style="font-size: 10pt;" size="2">re called<font style="font-size: 10pt;" size="2"> <font style="font-size: 10pt;" size="2">(</font>and thus </font>store<font style="font-size: 10pt;" size="2">d) <font style="font-size: 10pt;" size="2">to be then sele<font style="font-size: 10pt;" size="2">cted<font style="font-size: 10pt;" size="2">.</font> If <font style="font-size: 10pt;" size="2">featureselected <font style="font-size: 10pt;" size="2">neve<font style="font-size: 10pt;" size="2">r gets trig<font style="font-size: 10pt;" size="2">gered, that should mean that it is not<font style="font-size: 10pt;" size="2"> called<font style="font-size: 10pt;" size="2">.<font style="font-size: 10pt;" size="2"> <font style="font-size: 10pt;" size="2">The call<font style="font-size: 10pt;" size="2">back <font style="font-size: 10pt;" size="2">you show what actuall<font style="font-size: 10pt;" size="2">y <font style="font-size: 10pt;" size="2">does? <font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2">I</font> think ta<font style="font-size: 10pt;" size="2">king a look to the whole code will be more useful.<br><br><font style="font-size: 10pt;" size="2">Regards,<br><br><font style="font-size: 10pt;" size="2">Ger<font style="font-size: 10pt;" size="2">y</font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font><br><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><br>__________________________________________________________________________________________<br>Piensa en el medio ambie<font style="" 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" size="2"><br></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2">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" size="2"><br></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span> <span class="ecxhps">die Umwelt</span></span></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span> <span class="ecxhps">bewahren Sie es</span> <span class="ecxhps">auf dem Bildschirm.</span> <span class="ecxhps">Drucken Sie es NICHT</span><span>, wenn</span> <span class="ecxhps">es NICHT notwendig ist</span><span>.</span></span></font><br><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Wed, 20 Feb 2013 09:23:02 +0200<br>From: lauri.kajan@gmail.com<br>To: openlayers-users@lists.osgeo.org<br>Subject: Re: [OpenLayers-Users] GetFeature with WFS protocol doesn't return features<br><br><div dir="ltr">Hi Gery,<div><br></div><div>The execution never get that far. Featureselected is not triggered.</div><div>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><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><div style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre;">
<span>callback</span>: <span>function</span>(<span>result</span>) {</div><div style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre;">
<span>if</span>(<span>result</span>.<span>success</span>()) {</div><div 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 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 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 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 style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre;"> } else {</div>
<div 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 style="color:rgb(0,0,0);font-family:Consolas,'Lucida Console',monospace;font-size:12px;line-height:14px;white-space:pre;">
}</div></div><div><br></div></div></div><div>-Lauri</div><div><br></div></div></div><div class="ecxgmail_extra"><br><br><div class="ecxgmail_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="ecxgmail_quote" style="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>
<br>_______________________________________________
Users mailing list
Users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users</div> </div></body>
</html>