<div dir="ltr">Hi again,<div><br></div><div style>The problem still occurs.</div><div style>And I can now confirm that it is not due any incomplete server response. I looked network traffic with fiddler and it revealed that the response is valid gml. I even copied the respond to a file and it opens to QGIS with no problems.</div>
<div style><br></div><div style>Have any of you any ideas what to look next. How should I debug this?</div><div style><br></div><div style><br></div><div style>Here is my completed code:</div><div style><div>var selection = new OpenLayers.Control.GetFeature({</div>
<div>    protocol: new OpenLayers.Protocol.WFS({</div><div>                version: "1.1.0",</div><div>                url: "***",</div><div>                featurePrefix: '***',</div><div>                featureType: "***",</div>
<div>                featureNS: "***",</div><div>                geometryName: "geom",</div><div>                srsName: "EPSG:3067",</div><div>                outputFormat: "GML2"</div>
<div>            }),</div><div>            click: true,</div><div>            clickTolerance: 1,</div><div>            single: true,</div><div>            hover: false </div><div>});</div><div>selection.events.register("featureselected", this, function(e) {</div>
<div>    //do something with the feature</div><div>});</div><div><br></div><div>map.addControl(selection);</div><div>selection.activate();</div></div><div style><br></div><div style>-Lauri</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Feb 20, 2013 at 4:18 PM, 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 dir="auto"><div>Could you paste the server responses and URL? I've never work with proxi.cgi because I test and run things in local machines for both client and backend. I've read once some problems about longer strings, perhaps that's the issue.<br>
<br>Sent from my iBath</div><div><div class="h5"><div><br>On Feb 20, 2013, at 14:59, "Lauri Kajan" <<a href="mailto:lauri.kajan@gmail.com" target="_blank">lauri.kajan@gmail.com</a>> wrote:<br><br></div><div>
<div dir="ltr">I think I found the reason, but not yet any solution.<div><br></div><div>Actually the response that wfs-server sent was not valid. It was cutted after around 23000 characters.</div><div>What could affect that. Is it the proxy.cgi that cannot pass longer strings or is something else?</div>

<div><br></div><div>-Lauri</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 20, 2013 at 11:04 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">Hi Lauri,<br><br><font style="font-size:10pt"><font style="font-size:10pt"><font style="font-size:10pt"><font style="font-size:10pt">not sure but the problem can be related to how the feat<font style="font-size:10pt">ures a<font style="font-size:10pt">re called<font style="font-size:10pt"> <font style="font-size:10pt">(</font>and thus </font>store<font style="font-size:10pt">d) <font style="font-size:10pt">to be then sele<font style="font-size:10pt">cted<font style="font-size:10pt">.</font> If <font style="font-size:10pt">featureselected <font style="font-size:10pt">neve<font style="font-size:10pt">r gets trig<font style="font-size:10pt">gered, that should mean that it is not<font style="font-size:10pt"> called<font style="font-size:10pt">.<font style="font-size:10pt"> <font style="font-size:10pt">The call<font style="font-size:10pt">back <font style="font-size:10pt">you show what actuall<font style="font-size:10pt">y <font style="font-size:10pt">does? <font style="font-size:10pt"><font style="font-size:10pt">I</font> think ta<font style="font-size:10pt">king a look to the whole code will be more useful.<br>

<br><font style="font-size:10pt">Regards,<br><br><font style="font-size:10pt">Ger<font style="font-size:10pt">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><div>

<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></div><hr>Date: Wed, 20 Feb 2013 09:23:02 +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: Re: [OpenLayers-Users] GetFeature with WFS protocol doesn't return features<div><div><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="line-height:14px;font-size:12px;white-space:pre-wrap;font-family:Consolas,'Lucida Console',monospace">


            <span>callback</span>: <span>function</span>(<span>result</span>) {</div><div style="line-height:14px;font-size:12px;white-space:pre-wrap;font-family:Consolas,'Lucida Console',monospace">
                <span>if</span>(<span>result</span>.<span>success</span>()) {</div><div style="line-height:14px;font-size:12px;white-space:pre-wrap;font-family:Consolas,'Lucida Console',monospace">
                    if(result.features.length) {</div><div style="line-height:14px;font-size:12px;white-space:pre-wrap;font-family:Consolas,'Lucida Console',monospace">                        if(options.single == true) {</div>


<div style="line-height:14px;font-size:12px;white-space:pre-wrap;font-family:Consolas,'Lucida Console',monospace">                            this.selectBestFeature(result.features,</div><div style="line-height:14px;font-size:12px;white-space:pre-wrap;font-family:Consolas,'Lucida Console',monospace">


                                bounds.getCenterLonLat(), options);</div><div style="line-height:14px;font-size:12px;white-space:pre-wrap;font-family:Consolas,'Lucida Console',monospace">                        } else {</div>


<div style="line-height:14px;font-size:12px;white-space:pre-wrap;font-family:Consolas,'Lucida Console',monospace">                            this.select(result.features);</div><div style="line-height:14px;font-size:12px;white-space:pre-wrap;font-family:Consolas,'Lucida Console',monospace">


                        }</div></div><div><br></div></div></div><div>-Lauri</div><div><br></div></div></div><div><br><br><div>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 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><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
<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>                                       </div></div>
</blockquote></div><br></div>
</div><div><span>_______________________________________________</span><br><span>Users mailing list</span><br><span><a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a></span><br><span><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a></span><br>
</div></div></div></div></blockquote></div><br></div>