I did change it to WFS.v1_1_0 but for some reason I keep getting this error,<div><br><div><font color="#ff0000">TypeError: e.features is null</font></div><div><br></div><div> in the function,</div><div><br></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
function processSpatialQuery(e) </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="white-space:pre-wrap"> </span>{ </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="white-space:pre-wrap"> </span>//output data here </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="white-space:pre-wrap"> </span>alert(e.features[0].attributes.Orig_AddrKey); </div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="white-space:pre-wrap"> </span>}</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Why is it not collecting any data?</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Thanks,</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Smaran</div><div><br></div><div><br><br><div class="gmail_quote">On Mon, Sep 24, 2012 at 2:12 PM, Phil Scadden <span dir="ltr"><<a href="mailto:p.scadden@gns.cri.nz" target="_blank">p.scadden@gns.cri.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div class="im">
<br>
<blockquote type="cite">
<div><br>
</div>
<br>
<div>
<div>var pimaWFS = new OpenLayers.Layer.Vector("Pima Pine", {</div>
<div><span style="white-space:pre-wrap"> </span>
strategies: [new OpenLayers.Strategy.BBOX()],</div>
<div><span style="white-space:pre-wrap"> </span>
protocol: new OpenLayers.Protocol.WFS({</div>
<div><span style="white-space:pre-wrap"> </span>
url: "<a href="http://128.196.142.12:8080/geoserver/wfs" target="_blank">http://128.196.142.12:8080/geoserver/wfs</a>",</div>
<div><span style="white-space:pre-wrap"> </span>
featureType: "PimaPine",</div>
<div><span style="white-space:pre-wrap"> </span>
featureNS: "<a href="http://opengeo.org" target="_blank">http://opengeo.org</a>",</div>
<div><span style="white-space:pre-wrap"> </span>
srsName: "EPSG:4326"</div>
<div><span style="white-space:pre-wrap"> </span>
})</div>
<div><span style="white-space:pre-wrap"> </span>
});</div>
<div><br>
</div>
<div>But still I have no luck despite specifying the srsName.</div>
</div>
</blockquote></div>
Nope. You MUST tell it to use v1_1_0 or srs isnt honoured.<br>
ie protocol: new OpenLayers.Protocol.WFS.v1_1_0({
<div class="im"><blockquote type="cite">
<div>
<div><br>
</div>
<div>My Geoserver is 2.1 and seems to be the latest build. How
can I check if it supports WFS 1.1.0 or not??</div>
</div>
</blockquote></div>
It supports 1.1 (you get details of what a server supports from
WFSGetcapabilities call.<div class="im"><br>
<br>
<p><span style="font-size:8pt;font-family:'Arial'">Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.</span></p>
<p><span style="font-size:8pt;font-family:'Arial'"> </span></p></div></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks & Regards<div>Smaran Harihar</div><br>
</div></div></div>