Hi Bart,<div><br></div><div>I used the 'For Each' instead since I was not able to find out how to count the features in 'e.features'. It works fine, the only issue is that, as I come to the end of the 'for each' loop, the 'feat.attributes' becomes undefined.</div>


<div><br></div><div>I am not sure why does that happen. I am trying to over-ride it by adding a conditional statement but can you tell me what is the real cause behind it? Here is my code,</div><div><br></div><div><div>var attrData = [];</div>


<div><span style="white-space:pre-wrap">                  </span>for each(var feat in e.features) {</div><div><span style="white-space:pre-wrap">                               </span>if (feat.attributes !== undefined) { //this is the conditional statement</div>
<div><span style="white-space:pre-wrap">                                  </span>attrData.push([feat.attributes.Family, feat.attributes.Species])</div><div><span style="white-space:pre-wrap">                         </span>}</div><div>
<span style="white-space:pre-wrap">                     </span>}</div><div><br></div><div>Thanks,</div><div>Smaran</div><br><div class="gmail_quote">On Tue, Sep 25, 2012 at 12:19 AM, Bart van den Eijnden <span dir="ltr"><<a href="mailto:bartvde@opengeo.org" target="_blank">bartvde@opengeo.org</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">The WFS response is in EPSG:4326.<div><br></div><div>If you want to overlay your WFS layer on a basemap with EPSG:900913, you should also use that SRS in the WFS protocol and let the server reproject for you.</div>


<div><br></div><div>Best regards,</div><div>Bart</div><span><font color="#888888"><div><br></div><div>-- </div></font></span><div><span><font color="#888888"><div><span style="border-collapse:separate;border-spacing:0px"><div>


Bart van den Eijnden<br>OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org</a><br>Expert service straight from the developers.</div><div><br></div></span><br>

</div></font></span><div><div>
<br><div><div>On Sep 25, 2012, at 7:35 AM, Smaran Harihar <<a href="mailto:smaran.harihar@gmail.com" target="_blank">smaran.harihar@gmail.com</a>> wrote:</div><br><blockquote type="cite">I have updated the WFS Layer with .v1_1_0 but still the WFS projection is wrong.<div>


<br></div><div><div>var pimaWFS = new OpenLayers.Layer.Vector("Pima Pine WFS", {</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.v1_1_0({</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> });<span style="white-space:pre-wrap">    </span> <span style="white-space:pre-wrap">       </span> </div>




<div><span style="white-space:pre-wrap">                                          </span> </div><div><span style="white-space:pre-wrap">                                </span>wfsProtocol = new OpenLayers.Protocol.WFS.v1_1_0({</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><br></div><div>Here is the <a href="http://128.196.142.12/geo/test/test_new.html" target="_blank">application</a>, that orange dot that you see is the WFS layer which is suppose to overlap the blue stars.</div>




<div><br></div><div>Thanks,</div><div>Smaran</div><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>
    <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><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><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>


<div><span style="font-size:8pt;font-family:'Arial'"> </span><br></div></div></div>

<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org" target="_blank">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>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.osgeo.org" target="_blank">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>


</blockquote></div><br></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks & Regards<div>Smaran Harihar</div><br>
</div>