Hi List,<br><br>I'm trying to use OpenLayers and Mapserver as a WFS. I'm having some difficulty understanding how to deal with projections within the browser and on the server-side. Within OpenLayers I have the following html:<br>
<br><html><br><head><br> <title>OpenLayers Example</title><br> <script src="<a href="http://openlayers.org/api/OpenLayers.js">http://openlayers.org/api/OpenLayers.js</a>"></script><br>
<script type="text/javascript" src="<a href="http://maps.googleapis.com/maps/api/js?sensor=false">http://maps.googleapis.com/maps/api/js?sensor=false</a>"></script><br> </head><br>
<body><br> <div style="width:100%; height:100%" id="map"></div><br> <script type="text/javascript"><br> <br> mapOptions = {<br> projection: new OpenLayers.Projection("EPSG:3857"),<br>
units: "m",<br> maxExtent: new OpenLayers.Bounds(-715222.69, 6422313.80, 196915.72, 7521021.46)<br> };<br><br> map = new OpenLayers.Map('map', mapOptions);<br><br> var googleLayer = new OpenLayers.Layer.Google('Google', {type: google.maps.MapTypeId.SATELLITE}, {"sphericalMercator": true});<br>
map.addLayer(googleLayer);<br><br><br> // Add WFS data<br> var wfsLayer= new OpenLayers.Layer.Vector("WFS", {<br> strategies: [new OpenLayers.Strategy.BBOX()], <br> protocol: new OpenLayers.Protocol.WFS({<br>
url: "<a href="http://mysite.com/mapserv.cgi/wfs?&map=wfs_mlsoa.map&">http://mysite.com/mapserv.cgi/wfs?&map=wfs_mlsoa.map&</a>",<br> featureType: "mlsoa",<br> featureNS: "<a href="http://mapserver.gis.umn.edu/mapserver">http://mapserver.gis.umn.edu/mapserver</a>",<br>
srsName: "EPSG:3857",<br> version: "1.1.0", <br> geometryName: "NAME" <br> })<br> });<br><br> //add layers<br> map.addLayers([googleLayer,wfsLayer]);<br>
<br></script><br></body><br></html><br><br>And on my mapserver side I state that my map/data has the following projection:<br><br> PROJECTION<br> "init=epsg:3857"<br> END<br><br>and extents<br>
<br>EXTENT -715222.69 6422313.80 196915.72 7521021.46<br><br>I am assuming that it is ok to use the epsg:3857 code (the equivalent of epsg:900913) with data projected using ESRI's 'Mercator_Auxilary_Sphere'. However, I cannot get my bbox to retrieve the data. The shapefile is an outline of England. When I view the post/get using Firebug I see that the response is:<br>
<br><gml:boundedBy>
<br><gml:null>unknown</gml:null>
<br></gml:boundedBy>
<br><br>I saw that this question about changing projections <a href="http://osgeo-org.1803224.n2.nabble.com/wfs-openlayers-non-native-projection-td6146097.html">http://osgeo-org.1803224.n2.nabble.com/wfs-openlayers-non-native-projection-td6146097.html</a> which is why I tried to overwrite the default options. I'm not sure what else to try and would appreciate any suggestions.<br>
<br>Thank you,<br>David<br><br><br><br><br>