<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Firstly, thank you Alexandre for helping to point me to the right
    point in the source.&nbsp; I had been debugging with firebug and was able
    to locate the point at which the points were being parsed in
    OL.Format.GML.v3.js, but was stumped as to why the layer.features
    continued to remain empty.<br>
    <br>
    Secondly, it appears this problem existed at two separate points.
    The first point was that I was not specifying the geometryName in my
    initial script. Since my geometry name was not "the_geom" (which is
    the default value according to the OL docs) but "msGeometry" the
    features where not found.<br>
    <br>
    When I added the geometryName property I also (foolishly) added a
    "version" property and set this to 1.1.0.&nbsp; At this point, when I
    stepped through the code I could clearly see the points being
    parsed, but no features were found and thus none were rendered.<br>
    <br>
    After removing the "versions" property the features were parsed and
    rendered as expected.&nbsp; I'm not sure why I added the "version"
    property, but clearly this is what was preventing the features from
    being properly parsed once I had the correct geometryName defined.<br>
    <br>
    Thanks again Alexandre for your insight into the added metadata for
    the map file.&nbsp; I will explore that option as well and see which
    makes my life easier.<br>
    <br>
    Cheers!<br>
    <br>
    Mark K. Zanfardino<br>
    <br>
    On 06/08/2011 08:47 AM, Alexandre Dube wrote:
    <blockquote cite="mid:4DEF999E.8020201@mapgears.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      Hi,<br>
      <br>
      &nbsp; This seems to be a matter of feature namespace.&nbsp; In OpenLayers,
      XML is read using the namespaces of a node as the way to detect
      the according reader for it.&nbsp; If not set in the protocol,
      OpenLayers sets "feature" as default prefix for feature nodes.&nbsp; In
      MapServer, the default value outputed in the GML is "ms" as you
      can see in yours.&nbsp; You can either adjust OpenLayers to your
      MapServer settings [1] or the opposite [2] in order to read the
      nodes accordingly.<br>
      <br>
      [1] set feature prefix and namespace in your protocol (OpenLayers)
      according to MapServer settings<br>
      <br>
      protocol: new OpenLayers.Protocol.WFS({<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; url: mapPath,<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; featureType: "tenszones",<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; featurePrefix: "ms",<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; featureNS: "<a moz-do-not-send="true"
        class="moz-txt-link-rfc2396E"
        href="http://mapserver.gis.umn.edu/mapserver">http://mapserver.gis.umn.edu/mapserver</a>"<br>
      &nbsp;&nbsp;&nbsp; &nbsp; }),<br>
      <br>
      [2] or set your feature namespace to OpenLayers default value in
      your mapfile (in your MAP, METADATA tag):<br>
      <br>
      "wfs_namespace_prefix" "feature"<br>
      "wfs_namespace_uri" <a moz-do-not-send="true"
        class="moz-txt-link-rfc2396E" href="http://localhost">"http://localhost"</a><br>
      <br>
      Before making any changes, you could use firebug with an
      uncompressed version of OpenLayers (2.10) and set a breakpoint in
      ./lib/OpenLayers/Format/XML.js on line 621 :<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var group = this.readers[node.namespaceURI ?
      this.namespaceAlias[node.namespaceURI]: this.defaultPrefix];<br>
      <br>
      Inspect the elements there until you reach your node that doesn't
      get read properly and you'll see why it isn't and how it works as
      well.<br>
      <br>
      HTH,<br>
      <br>
      Alexandre<br>
      <br>
      <br>
      On 11-06-08 11:12 AM, Mark K. Zanfardino wrote:
      <blockquote cite="mid:4DEF9172.4030800@gmail.com" type="cite">
        <meta http-equiv="content-type" content="text/html;
          charset=ISO-8859-1">
        OpenLayers version 2.10 <br>
        MapServer version 5.6.6 <br>
        <br>
        Goal: Render vector layer based on WFS protocol<br>
        <br>
        I'm trying to understand why a vector layer will not render on
        my map. I can clearly see the layer in the layerSwitcher control
        so I presume the layer is being presented, but there are no
        actual features rendered.<br>
        <br>
        The vector layer is defined using a WFS protocol:<br>
        <blockquote>tens = new OpenLayers.Layer.Vector("TENS", <br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
          &nbsp;&nbsp;&nbsp; &nbsp; strategies: [new OpenLayers.Strategy.BBOX()],<br>
          &nbsp;&nbsp;&nbsp; &nbsp; protocol: new OpenLayers.Protocol.WFS({<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; url: mapPath,<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; featureType: "tenszones",<br>
          &nbsp;&nbsp;&nbsp; &nbsp; }),<br>
          &nbsp;&nbsp;&nbsp; &nbsp; styleMap: new OpenLayers.StyleMap({<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strokeWidth: 3,<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strokeColor: "#333333"<br>
          &nbsp;&nbsp;&nbsp; &nbsp; }),<br>
          &nbsp;&nbsp;&nbsp; &nbsp; filter: new OpenLayers.Filter.Logical({<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type: OpenLayers.Filter.Logical.NOT,<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filters: [<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; new OpenLayers.Filter.Comparison({<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type: OpenLayers.Filter.Comparison.EQUAL_TO,<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; property: "name",<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value: "County0"<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; })<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br>
          &nbsp;&nbsp;&nbsp; &nbsp; })<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
          &nbsp;&nbsp;&nbsp; &nbsp; isBaseLayer: false,<br>
          &nbsp;&nbsp;&nbsp; &nbsp; buffer: 0<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
          &nbsp; );<br>
        </blockquote>
        When I watch the page load I can clearly see the XML results
        from the WFS call (see XML output) but no features are rendered
        on the map. I'm following from the 'WFS Protocol and Filter'
        example. Any help would be appreciated.<br>
        <br>
        &lt;?xml version='1.0' encoding="ISO-8859-1" ?&gt;<br>
        &lt;wfs:FeatureCollection<br>
        &nbsp;&nbsp; xmlns:ms=<a moz-do-not-send="true"
          class="moz-txt-link-rfc2396E"
          href="http://mapserver.gis.umn.edu/mapserver">"http://mapserver.gis.umn.edu/mapserver"</a><br>
        &nbsp;&nbsp; xmlns:wfs=<a moz-do-not-send="true"
          class="moz-txt-link-rfc2396E"
          href="http://www.opengis.net/wfs">"http://www.opengis.net/wfs"</a><br>
        &nbsp;&nbsp; xmlns:gml=<a moz-do-not-send="true"
          class="moz-txt-link-rfc2396E"
          href="http://www.opengis.net/gml">"http://www.opengis.net/gml"</a><br>
        &nbsp;&nbsp; xmlns:ogc=<a moz-do-not-send="true"
          class="moz-txt-link-rfc2396E"
          href="http://www.opengis.net/ogc">"http://www.opengis.net/ogc"</a><br>
        &nbsp;&nbsp; xmlns:xsi=<a moz-do-not-send="true"
          class="moz-txt-link-rfc2396E"
          href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a><br>
        &nbsp;&nbsp; xsi:schemaLocation="<a moz-do-not-send="true"
          class="moz-txt-link-freetext"
          href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a>
        <a moz-do-not-send="true" class="moz-txt-link-freetext"
          href="http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd</a>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a moz-do-not-send="true"
          class="moz-txt-link-freetext"
          href="http://mapserver.gis.umn.edu/mapserver">http://mapserver.gis.umn.edu/mapserver</a>
        <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://localhost/cgi-bin/mapserv?map=/home/mark/htdocs/sandbox/contra_costa/mapdata/cws.map&amp;amp;SERVICE=WFS&amp;amp;VERSION=1.0.0&amp;amp;REQUEST=DescribeFeatureType&amp;amp;TYPENAME=tenszones&amp;amp;OUTPUTFORMAT=XMLSCHEMA">http://localhost/cgi-bin/mapserv?map=/home/mark/htdocs/sandbox/contra_costa/mapdata/cws.map&amp;amp;SERVICE=WFS&amp;amp;VERSION=1.0.0&amp;amp;REQUEST=DescribeFeatureType&amp;amp;TYPENAME=tenszones&amp;amp;OUTPUTFORMAT=XMLSCHEMA</a>"&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;gml:boundedBy&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;gml:Box srsName="EPSG:4326"&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;gml:coordinates&gt;-122.430673,37.902872
        -121.783758,38.058186&lt;/gml:coordinates&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/gml:Box&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/gml:boundedBy&gt;<br>
        &nbsp;&nbsp;&nbsp; &lt;gml:featureMember&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ms:tenszones fid="tenszones.2"&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;gml:boundedBy&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;gml:Box srsName="EPSG:4326"&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;gml:coordinates&gt;-121.882119,38.004151
        -121.822493,38.034986&lt;/gml:coordinates&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/gml:Box&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/gml:boundedBy&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ms:msGeometry&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;gml:Polygon srsName="EPSG:4326"&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;gml:outerBoundaryIs&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;gml:LinearRing&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;gml:coordinates&gt;-121.826546,38.024671
        -121.825545,38.018151 -121.822493,38.015989
        -121.832033,38.004151 -121.847393,38.007365
        -121.876296,38.018261 -121.875579,38.022347
        -121.882119,38.024341 -121.880209,38.032456
        -121.878309,38.034986 -121.826546,38.024671
        &lt;/gml:coordinates&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/gml:LinearRing&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/gml:outerBoundaryIs&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/gml:Polygon&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ms:msGeometry&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ms:gid&gt;2&lt;/ms:gid&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ms:area&gt;0.00104289122555201&lt;/ms:area&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        &lt;ms:perimeter&gt;0.147388060113902&lt;/ms:perimeter&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ms:name&gt;DOW0&lt;/ms:name&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ms:tenszones&gt;<br>
        &nbsp;&nbsp;&nbsp; &lt;/gml:featureMember&gt;<br>
        &nbsp;&nbsp;&nbsp; &lt;gml:featureMember&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ms:tenszones fid="tenszones.3"&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;gml:boundedBy&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;gml:Box srsName="EPSG:4326"&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;gml:coordinates&gt;-121.837932,37.999340
        -121.819430,38.024672&lt;/gml:coordinates&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/gml:Box&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/gml:boundedBy&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ms:msGeometry&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;gml:Polygon srsName="EPSG:4326"&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;gml:outerBoundaryIs&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;gml:LinearRing&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;gml:coordinates&gt;-121.826535,38.024672
        -121.819800,38.022000 -121.819430,38.004870
        -121.821310,37.999340 -121.837932,38.003598
        -121.836350,38.005070 -121.832027,38.004150
        -121.822495,38.015991 -121.825510,38.018100
        -121.826535,38.024672 &lt;/gml:coordinates&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/gml:LinearRing&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/gml:outerBoundaryIs&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/gml:Polygon&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ms:msGeometry&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ms:gid&gt;3&lt;/ms:gid&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ms:area&gt;0.000183226789886248&lt;/ms:area&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        &lt;ms:perimeter&gt;0.0794914873797834&lt;/ms:perimeter&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ms:name&gt;DOW1&lt;/ms:name&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ms:tenszones&gt;<br>
        &nbsp;&nbsp;&nbsp; &lt;/gml:featureMember&gt;<br>
        &lt;/wfs:FeatureCollection&gt;
        <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
</pre>
      </blockquote>
      <br>
      <br>
      <pre class="moz-signature" cols="72">-- 
Alexandre Dub&eacute;
Mapgears
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.mapgears.com">www.mapgears.com</a>
</pre>
      <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
</pre>
    </blockquote>
  </body>
</html>