I am a student enginner in GIS , I want to load my features from geoserver using WFS protocol. I'm using this code but it's not appearing in my browser
OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";
var map,wfs;
function init() {
//-11593508, 5509847, -11505759, 5557774
var extent = new OpenLayers.Bounds(
474813, 211897, 491713, 227436.5
);
map = new OpenLayers.Map('map', {
controls: [
new OpenLayers.Control.PanZoom(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.LayerSwitcher({'ascending':false}),
]
});
var wms = new OpenLayers.Layer.WMS(
"test_postgres:territoire", "http://mylocalhost:8080/geoserver/test_postgres/wms",
{
LAYERS: 'test_postgres:territoire',
STYLES: '',
format: 'image/svg',
},
{
isBaseLayer: true,
}
);
var wfsLayer = new OpenLayers.Layer.Vector("WFS", {
strategies: [new OpenLayers.Strategy.BBOX()],
styleMap: new OpenLayers.StyleMap({
strokeWidth: 3,
strokeColor: "#333333"
})
});
map.addLayer(wfsLayer);
map.zoomToMaxExtent();