AW: [OpenLayers-Users] Re: How to use Protocol.WFS to replace Layer.WFS

Arnd Wippermann arnd.wippermann at web.de
Wed Apr 25 12:42:00 EDT 2012


I can't believe, that your WFS layer would show anything. You haven't
declared a "typename".

Protocol.WFS seems not to support maxfeatures or vendor params. But you can
add these params
to the url of the WFS Server.

projection and srsName are only needed, if the requested features are not in
the map projection.

 var wfslayer = new OpenLayers.Layer.Vector("WFS", {
    title     : "WFS Server Projection 4326",
    projection: new OpenLayers:projection("EPSG:4326"),
    //strategies: [new OpenLayers.Strategy.Fixed()],
    strategies: [new OpenLayers.Strategy.BBOX()],
    protocol: new OpenLayers.Protocol.WFS({
              url:  WFS_SERVER_URL + "?maxfeatures=1&nocache=" + (new
Date()).getTime(),
              geometryName: "msGeometry",
              featurePrefix: "ms",
              featureType: "punkte",
              featureNS: "http://mapserver.gis.umn.edu/mapserver",
              srsName: "EPSG:4326",
              version: "1.0.0"
    }),
    displayInLayerSwitcher: false,
    styleMap: new OpenLayers.StyleMap({
      'default': {
        strokeColor: "black", strokeWidth: 1, fillColor: 'red',
        pointRadius: 5, fillOpacity: 1, strokeOpacity: 1
      },
    })
});

Regards,
Arnd

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von mazery
Gesendet: Mittwoch, 25. April 2012 01:48
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] Re: How to use Protocol.WFS to replace Layer.WFS

Whoops. Wrong link. Code is here;

http://pastebin.com/hGvbJwgj



--
View this message in context:
http://osgeo-org.1560.n6.nabble.com/How-to-use-Protocol-WFS-to-replace-Layer
-WFS-tp4915094p4915105.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list