In geoserver i have a layer in EPSG:4326. In OpenLayers i add it on map as WFS:
markerLayer = new OpenLayers.Layer.Vector('Markers',{
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
url: "/geoserver/wfs",
srsName:"EPSG:4326",
featureType: "markers",
featureNS: "http://www.opengeospatial.net/cite",
}),
projection:new OpenLayers.Projection("EPSG:900913"),
styleMap: new OpenLayers.StyleMap({
externalGraphic: url_servlet+'img/marker.png',
graphicWidth: 20, graphicHeight: 24, graphicYOffset: -24,
title: '${tooltip}'
})/*,
eventListeners: {
beforefeatureadded: function(e) {
e.feature.attributes.annotation =
window.prompt("annotation", "no comment");
}
}*/
});
app.mapPanel.map.addLayers([markerLayer]);
My map in OL in EPSG:900913. So when i says to WFS projection=900913 i exepcted that features reproject and will show on my map. But its show somewhere outside OSM extent. And in WFS layer i see features with coords like this:
POINT(62.01759636987174 56.767130970984326)
So how reproject wfs correctly?
UPDATE
I change protocol to HTTP and get gml:
protocol:new OpenLayers.Protocol.HTTP({
url: "/geoserver/ows?service=WFS&request=GetFeature&typeName=cite:markers&srsName=EPSG:900913&outputFormat=GML2",
format: new OpenLayers.Format.GML()
}),
And now i get something interesting:
My layers and Google Base layer:
Same place with OSM base layer:
You see that there is no more red markers. And i have only question What a hell going on?