Hey guys,<br><br>I spent the last two days trying to figure out how to solve this problem and I couldn't. I have Spherical Mercator tutorial on reprojecting vector data and I still can't figure out what I am doing wrong.<br>
<br>I am trying to overlay on Google Layer some vector data using WFS Protocol.<br><br>My problem is that whatever I do, OpenLayers request data from the server using BBOX Strategy with projection EPSG:900913 but my data is on projection EPSG:29193 and that gives me 2 problems:<br>
1- The server gives a null response;<br>or<br>2- The server gives back the xml with the data, but the projection is on 29193 and OpenLayers thinks it is on 900913, so it displays in the wrong place.<br><br>Here is the code for the map options:<br>
var options = {<br> maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),<br> numZoomLevels:18,<br> maxResolution:156543.0339,<br> units:'m',<br>
projection: "EPSG:900913",<br> displayProjection: new OpenLayers.Projection("EPSG:4326"),<br> controls: [ new OpenLayers.Control.PanZoom(), new OpenLayers.Control.MouseDefaults(), new OpenLayers.Control.LayerSwitcher() ]<br>
};<br><br>And here is the code for the layer options:<br>var layer = new OpenLayers.Layer.Vector("WFS", {<br> strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],<br> protocol: new OpenLayers.Protocol.WFS({<br>
url: "<a href="http://localhost:8080/geoserver/wfs">http://localhost:8080/geoserver/wfs</a>",<br> featureType: "Regional",<br> featureNS: "<a href="http://prodabel1062.pbh:8080/avis">http://prodabel1062.pbh:8080/avis</a>",<br>
geometryName: "GEOLOC",<br> srsName: "EPSG:29193"<br> }),<br> projection: new OpenLayers.Projection("EPSG:29193")<br>
});<br><br>As it is, I get null response from the server. And if I change the layer projection to "EPSG:900913", I get the response, but no drawing (as it will be in the wrong projection).<br><br>I have seen a thread in this list from Jachym Cepicky where he defined a handler for preFeatureInsert event and reprojected his vector data "manually". As I understand (from <a href="http://docs.openlayers.org/library/spherical_mercator.html#reprojecting-vector-data">http://docs.openlayers.org/library/spherical_mercator.html#reprojecting-vector-data</a>) this shouldn't be necessary, but right now I feel that is my only option left.<br>
<br>Would you guys mind sheding some light over my problem?<br><br>Thanks,<br>Pedro.<br>