[OpenLayers-Users] what is Code for wfs layer?

Ian Turton ijturton at gmail.com
Wed Feb 23 11:34:40 EST 2011


On 23 February 2011 11:18, Mustafa646 <noorcs22 at gmail.com> wrote:
>
> Below is code for WMS layer:
>
>  var wmslayer = new OpenLayers.Layer.WMS("US States",
> "http://localhost:8080/geoserver/wms", { 'layers': 'topp:states', 'format':
> 'image/png', 'transparent': 'true' }, {'opacity': 1.0,'isBaseLayer': false,
> 'visibility': true });
>
> What will be the similar code for WFS layer ?

from http://openlayers.org/dev/examples/wfs-states.html
var wfs = new OpenLayers.Layer.Vector("States", {
        strategies: [new OpenLayers.Strategy.BBOX()],
        protocol: new OpenLayers.Protocol.WFS({
            url: "http://demo.opengeo.org/geoserver/wfs",
            featureType: "states",
            featureNS: "http://www.openplans.org/topp"
        })
    });
    map.addLayer(wfs);

Ian
-- 
Ian Turton


More information about the Users mailing list