<div dir="ltr">Try removing the parameter "<span style="font-family:arial,sans-serif;font-size:13px">resultType: "hits".</span><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">(Your issue is the opposite of this one: </span></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><a href="http://gis.stackexchange.com/questions/45101/only-return-the-numberoffeatures-in-a-wfs-query">http://gis.stackexchange.com/questions/45101/only-return-the-numberoffeatures-in-a-wfs-query</a></font></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 12, 2014 at 1:24 PM, rickm81 <span dir="ltr"><<a href="mailto:rickm81@yahoo.com" target="_blank">rickm81@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello Alll,<br>
<br>
I am trying to retrieve feature data from a WMS layer hosted by GeoServer<br>
using a Vector layer drawn on a map. Unfortunately, I am only receiving the<br>
NumberOfFeatures selected. For example, I draw a polygon on the map that<br>
intersects 10 polygon features in the WMS layer. The NumberOfFeatures value<br>
returned is 10, but none of the feature data ("ID", "ADDRESS", "POLYNUMBER",<br>
etc.) is returned.<br>
<br>
Here is the code I am using to query the WMS Layer.<br>
<br>
// Create WMS Layer<br>
    census_blocks = new OpenLayers.Layer.WMS("Census Block Groups",<br>
"<a href="http://localhost:8080/geoserver/US_Census_Blocks_CensusSummary/wms" target="_blank">http://localhost:8080/geoserver/US_Census_Blocks_CensusSummary/wms</a>",<br>
    { 'layers':<br>
'2010_BlockGroups_US_CensusSummary:2010_BlockGroups_US_CensusSummary',<br>
transparent: true, format: 'image/png' },<br>
    { isBaseLayer: false });<br>
<br>
// Create Filter Using Polygon Drawn on Map<br>
    var pfilter = new OpenLayers.Filter.Spatial({<br>
        type: OpenLayers.Filter.Spatial.INTERSECTS,<br>
        value: e.feature.geometry // <== This is the polygon drawn on map<br>
    });<br>
<br>
// Create WFS From WMS, Pass in Filter, Handle Response<br>
    var wfsProtocol = new<br>
OpenLayers.Protocol.WFS.fromWMSLayer(census_blocks);<br>
    wfsProtocol.read({<br>
        filter: pfilter,<br>
        extractAttributes: true,<br>
        infoFormat: "application/vnd.ogc.gml",<br>
        resultType: "hits",<br>
        callback: function (resp) {<br>
            // Trying to access Feature Data here, but unsuccessful<br>
            alert(resp);<br>
        }<br>
    });<br>
<br>
I've looked at several examples online, but have not found a resolution. If<br>
any one has any ideas I would greatly appreciate it. Thank you!<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/WFS-fromWMSLayer-get-multiple-feature-attributes-tp5139854.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/WFS-fromWMSLayer-get-multiple-feature-attributes-tp5139854.html</a><br>

Sent from the OpenLayers Users mailing list archive at Nabble.com.<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>
</blockquote></div><br></div>