Hi all,<br><br>I've been working with a few people on #openlayers to help me out with a WFS issue. I'm posting this to the list because I may have found a bug in the process.<br><br>So, at one point, I packaged some of my WFS output into an XML file and tschaub wrote the following example for me (which worked, <a href="http://astro.temple.edu/~tub09307/tschaub.html">http://astro.temple.edu/~tub09307/tschaub.html</a>):<br>
<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><html><br> <head><br> <title>Brian's Data</title><br>
<script src="<a href="http://www.openlayers.org/api/OpenLayers.js">http://www.openlayers.org/api/OpenLayers.js</a>"></script><br> </head><br> <body><br> <div id="map" class="smallmap"></div><br>
<script><br> <br> var map = new OpenLayers.Map({<br> div: "map",<br> projection: new OpenLayers.Projection("EPSG:900913"),<br> units: "m",<br>
maxResolution: 500, // meters per pixel<br> maxExtent: new OpenLayers.Bounds(<br> -10462261, 5577086, -10305718, 5655358 // bounds of data<br> )<br> });<br>
<br> var traffic = new OpenLayers.Layer.Vector("Traffic", {<br> isBaseLayer: true,<br> strategies: [new OpenLayers.Strategy.BBOX()],<br> styleMap: style,<br> protocol:new OpenLayers.Protocol.WFS({<br>
version: "1.1.0",<br> url: "OpenLayers-2.8/examples/gml/test.xml",<br> featureType: "v_stats_20090101_000000",<br> featureNS: "<a href="http://192.168.0.20/geoserver/wms">http://192.168.0.20/geoserver/wms</a>",<br>
geometryName: "the_geom"<br> })<br> });<br><br> map.addLayer(traffic);<br> map.zoomToMaxExtent();<br><br> </script><br> <form><br>
</body><br></html><br></blockquote><br>I then modified it to this, which did not work:<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
<html><br> <head><br> <title>Brian's Data</title><br> <!-- added by bstempi --><br> <script src="<a href="http://www.openlayers.org/api/OpenLayers.js">http://www.openlayers.org/api/OpenLayers.js</a>"></script><br>
</head><br> <body><br> <div id="map" class="smallmap"></div><br> <script><br> <br> var map = new OpenLayers.Map({<br> div: "map",<br>
projection: new OpenLayers.Projection("EPSG:900913"),<br> units: "m",<br> maxResolution: 500, // meters per pixel<br> maxExtent: new OpenLayers.Bounds(<br>
-10462261, 5577086, -10305718, 5655358 // bounds of data<br> )<br> });<br><br> var traffic = new OpenLayers.Layer.Vector("Traffic", {<br> isBaseLayer: true,<br>
strategies: [new OpenLayers.Strategy.BBOX()],<br> protocol:new OpenLayers.Protocol.WFS({<br> version: "1.1.0",<br> //url: "test.xml",<br>
// modified by bstempi<br> url: "/geoserver/wms",<br> featureType: "v_stats_20090101_000000",<br> featureNS: "<a href="http://192.168.0.20/geoserver/wms">http://192.168.0.20/geoserver/wms</a>",<br>
geometryName: "the_geom"<br> })<br> });<br><br> map.addLayer(traffic);<br> map.zoomToMaxExtent();<br><br> </script><br> </body><br>
</html><br></blockquote><br>I found that the above code will work if you add srsName: "EPSG:900913" to the WFS options.<br><br>Is this a feature/bug/magic, or me being silly?<br><br>Thanks,<br>Brian Stempin<br>
<a href="mailto:brian.stempin@gmail.com">brian.stempin@gmail.com</a><br>