En geoserver tengo una capa en EPSG:4326. En OpenLayers la añado al mapa como 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]);
Mi mapa en OL en EPSG:900913. Así que cuando me dice que WFS proyección = 900913 me exepcted que las características reproject y se mostrará en mi mapa. Pero se muestra en algún lugar fuera de la extensión de OSM. Y en la capa WFS veo características con coords como este:
POINT(62.01759636987174 56.767130970984326)
Entonces, ¿cómo reproyectar correctamente el wfs?
ACTUALIZACIÓN
Cambio el protocolo a HTTP y obtengo 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()
}),
Y ahora tengo algo interesante: Mis capas y la capa de Google Base:
El mismo lugar con la capa base de OSM:
Ya ves que no hay más marcadores rojos. Y sólo tengo una pregunta ¿Qué diablos está pasando?