Hi,<br><br>if you just want to get the features in browser memory (that is, get them into a JavaScript variable) you can fetch them issuing an XHR to GeoServer rather than using a Vector layer that your map will not display at all (BTW, if you finally use that approach be sure that you use OpenLayers.Strategy.Fixed if you want to load all features - using BBOX will load only those in the map viewport). Note that this way you are just issuing a request to a server, there is nothing specifically related to WFS, features, GIS or anything. You can then use a Format.WFS to parse the features.<br>
<br>OpenLayers provides some facilities to perform cross-browser XHR. It would be, for example:<br><br>var processResponse = function(response) {<br>  // Do your stuff here, typically with response.responseText, something like <br>
  // var features = new OpenLayers.Format.WFS().read(response.responseText);<br>  // I didn&#39;t test it !!<br>}<br>OpenLayers.Request.issue({<br>  url: &#39;<a href="http://localhost:8081/geoserver/wfs">http://localhost:8081/geoserver/wfs</a>&#39;,<br>
  method: &#39;GET&#39;,<br>  params: {<br>    service: &#39;WFS&#39;,<br>    version: &#39;1.0.0&#39;,<br>    request: &#39;GetFeature&#39;,<br>    typeName: &#39;MyMap:MyLayer&#39;,<br>    success: processResponse<br>  }<br>
});<br><br clear="all">Best regards,<br><br>Xurxo Méndez Pérez<br><br><a href="http://blog.sonxurxo.com/" target="_blank">http://blog.sonxurxo.com</a><div><a href="http://www.sonxurxo.com/" target="_blank">http://www.sonxurxo.com</a></div>
<br>
<br><br><div class="gmail_quote">2011/5/24 IvanBell <span dir="ltr">&lt;<a href="mailto:Ivan.Bell@cca.com">Ivan.Bell@cca.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<p>One final thing before I sleep.  The following query (typed directly into the browser) returns the layer&#39;s features:</p>

<pre><blockquote>
<a href="http://localhost:8081/geoserver/wfs?service=wfs&amp;version=1.1.0&amp;request=GetFeature&amp;typeName=MyMap:MyLayer" target="_blank">http://localhost:8081/geoserver/wfs?service=wfs&amp;version=1.1.0&amp;request=GetFeature&amp;typeName=MyMap:MyLayer</a>
</blockquote>
</pre>

<p>Executing the query above returns the following:</p>

<pre><blockquote>
&lt;wfs:FeatureCollection numberOfFeatures=&quot;22&quot; timeStamp=&quot;2011-05-23T23:26:16.950-04:00&quot; xsi:schemaLocation=&quot;<a href="http://localhost:8081/MyMap" target="_blank">http://localhost:8081/MyMap</a> <a href="http://localhost:8081/geoserver/wfs?service=WFS&amp;version=1.1.0&amp;request=DescribeFeatureType&amp;typeName=MyMap%3AMyLayer" target="_blank">http://localhost:8081/geoserver/wfs?service=WFS&amp;version=1.1.0&amp;request=DescribeFeatureType&amp;typeName=MyMap%3AMyLayer</a> <a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a> <a href="http://localhost:8081/geoserver/schemas/wfs/1.1.0/wfs.xsd" target="_blank">http://localhost:8081/geoserver/schemas/wfs/1.1.0/wfs.xsd</a>&quot;&gt;
   &lt;gml:featureMembers&gt;
      &lt;MyMap:MyLayer gml:id=&quot;MyLayer.1&quot;&gt;
         &lt;MyMap:the_geom&gt;
            &lt;gml:MultiSurface srsDimension=&quot;2&quot; srsName=&quot;urn:x-ogc:def:crs:EPSG:68156405&quot;&gt;
               &lt;gml:surfaceMember&gt;
                  &lt;gml:Polygon&gt;
                     &lt;gml:exterior&gt;
                        &lt;gml:LinearRing&gt;
                           &lt;gml:posList&gt;3492.0015869140625 -3363.049072265625 2556.0007934570312 -3363.0496215820312 2566.0004272460938 -4540.960388183594 1848.4064331054688 -4534.499755859375 1848.4064331054688 -5648.319641113281 2556.0016479492188 -5648.319641113281 2556.0016479492188 -6855.0450439453125 3478.28564453125 -6845.04638671875 3492.0015869140625 -6846.075744628906 3503.0972900390625 -5607.562316894531 4951.1680908203125 -5596.262756347656 4938.001708984375 -4642.6566162109375 3512.1845703125 -4641.047546386719 3492.0015869140625 -3363.049072265625&lt;/gml:posList&gt;
                        &lt;/gml:LinearRing&gt;&lt;
                     /gml:exterior&gt;
                  &lt;/gml:Polygon&gt;
               &lt;/gml:surfaceMember&gt;
            &lt;/gml:MultiSurface&gt;
         &lt;/MyMap:the_geom&gt;
         &lt;MyMap:Id&gt;2&lt;/MyMap:Id&gt;
      &lt;/MyMap:MyLayer&gt;
   &lt;MyMap:MyLayer gml:id=&quot;MyLayer.2&quot;&gt;
      &lt;MyMap:the_geom&gt;
         &lt;gml:MultiSurface srsDimension=&quot;2&quot; srsName=&quot;urn:x-ogc:def:crs:EPSG:68156405&quot;&gt;
            &lt;gml:surfaceMember&gt;
               &lt;gml:Polygon&gt;
                  &lt;gml:exterior&gt;
                     &lt;gml:LinearRing&gt;
                        &lt;gml:posList&gt;
                           3522.3305053710938 1036.248291015625 2586.3297119140625 1036.2476806640625 2596.3291015625 -141.6632080078125 1878.7352905273438 -135.20257568359375 1878.7352905273438 -1249.0225830078125 2586.330322265625 -1249.0225830078125 2586.330322265625 -2455.747802734375 3508.6143188476562 -2445.7493286132812 3522.3305053710938 -2446.7785034179688 3533.4263305664062 -1208.2650756835938 4981.4970703125 -1196.965576171875 4968.330505371094 -243.359375 3542.5133056640625 -241.75048828125 3522.3305053710938 1036.248291015625&lt;/gml:posList&gt;
                        &lt;/gml:LinearRing&gt;
                     &lt;/gml:exterior&gt;
                  &lt;/gml:Polygon&gt;
               &lt;/gml:surfaceMember&gt;
            &lt;/gml:MultiSurface&gt;
         &lt;/MyMap:the_geom&gt;
         &lt;MyMap:Id&gt;2&lt;/MyMap:Id&gt;
      &lt;/MyMap:MyLayer&gt;
   &lt;MyMap:MyLayer gml:id=&quot;MyLayer.3&quot;&gt;
      &lt;MyMap:the_geom&gt;
         &lt;gml:MultiSurface srsDimension=&quot;2&quot; srsName=&quot;urn:x-ogc:def:crs:EPSG:68156405&quot;&gt;
            &lt;gml:surfaceMember&gt;
               &lt;gml:Polygon&gt;
                  &lt;gml:exterior&gt;
                     &lt;gml:LinearRing&gt;
                        &lt;gml:posList&gt;
                           -734.0172119140625 5564.245300292969 -2226.5150146484375 5537.9622802734375 -2226.0020751953125 4616.246276855469 -749.6724853515625 4581.516906738281 -749.6724853515625 3374.7916870117188 -557.3804931640625 3364.8572998046875 140.07470703125 3363.828125 151.17047119140625 4473.9202880859375 915.5023193359375 4485.219909667969 902.335693359375 5642.824890136719 168.80548095703125 5643.652526855469 149.22967529296875 6830.244079589844 -543.664306640625 6846.854919433594 -733.727294921875 6869.757080078125 -734.0172119140625 5564.245300292969&lt;/gml:posList&gt;
                        &lt;/gml:LinearRing&gt;
                     &lt;/gml:exterior&gt;
                  &lt;/gml:Polygon&gt;
               &lt;/gml:surfaceMember&gt;
            &lt;/gml:MultiSurface&gt;
         &lt;/MyMap:the_geom&gt;
         &lt;MyMap:Id&gt;2&lt;/MyMap:Id&gt;
      &lt;/MyMap:MyLayer&gt;
   &lt;/gml:featureMembers&gt;
&lt;/wfs:FeatureCollection&gt;
</blockquote>
</pre>

<p>So, executing the query directly to the map server (i.e., GeoServer) works.  What is the equivalent &quot;new OpenLayers.Layer.Vector&quot; call and the corresponding &quot;featureType&quot; and &quot;featureNS&quot;?</p>


        <div>Up the Irons!!!</div>
<br><hr width="300" align="left">
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/Get-Features-from-a-WMS-Layer-tp6396039p6397114.html" target="_blank">Re: Get Features from a WMS Layer</a><div><div></div><div class="h5"><br>

Sent from the <a href="http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Users-f1822463.html" target="_blank">OpenLayers Users mailing list archive</a> at Nabble.com.<br></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>