[OpenLayers-Users] Cannot see Geoserver Vector Layer With WFS
Protocol
McGee, David
DMcGee at richmond.ca
Wed Oct 12 20:11:03 EDT 2011
Hi List,
I'm very new to OpenLayers, and would greatly appreciate help with what
I'm doing wrong. I cannot get vector layers sourced from Geoserver to
display using the WFS Protocol. Please see the example below.
Thanks in advance,
David McGee
<!DOCTYPE html>
<html>
<head>
<title>WFS Visibility</title>
<link rel="stylesheet"
href="http://www.openlayers.org/dev/examples/style.css" type="text/css">
<script src="http://www.openlayers.org/dev/OpenLayers.js"></script>
<script type="text/javascript">
function init(){
var map = new OpenLayers.Map( 'map' );
var base = new OpenLayers.Layer.WMS( "WMS base",
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{
layers: "basic",
transparent: "true",
format: "image/png"
},
{isBaseLayer: true, visibility: true}
);
var poi_wfs = new OpenLayers.Layer.Vector("poi WFS", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS ({
url: "http://demo.opengeo.org/geoserver/wfs",
featureType: "poi",
featureNS: "http://www.census.gov",
srsName: "EPSG:4326",
version: "1.1.0"
})
});
map.addLayers([base,poi_wfs]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<div id="map" class="smallmap"></div>
</body>
</html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20111012/057629e8/attachment.html
More information about the Users
mailing list