Possible Duplicate:
Problems with OpenLayers and WFS - proxy.cgi issues
hi friends i have a problem with simple openlayer web page. i have two layer, first one is wms layer and work perfectly on quantum gis and openlayers but second layer wfs(tasmania_road) work on quantum gis but dont work on openlayers. i simply show two layer which wfs tasmania_road on the wms earth . my code shown below, please help me, thanks
<html>
<head>
<script type="text/javascript">
var map;
function init() {
OpenLayers.ProxyHost = "proxy.cgi?url=";
map = new OpenLayers.Map('rcp1_map');
var wms = new OpenLayers.Layer.WMS(
"OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0",
{ layers: 'basic' }
);
var layer = new OpenLayers.Layer.Vector("WFS", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: "http://demo.opengeo.org/geoserver/wfs",
featureType: "tasmania_roads",
featureNS: "http://www.openplans.org/topp"
})
});
map.addLayer(wms);
map.addLayers([wms, layer]);
map.setCenter(new OpenLayers.LonLat(146.7, -41.8), 6);
}
</script>
</head>
<body onload="init()">
<div id="rcp1_map" style="width: 100%; height: 100%;">
</div>
</body>
</html>
