如何在Openlayers中使用WFS

时间:2018-06-27 01:45:25

标签: javascript openlayers geoserver

我试图在Openlayers 2.8中具有可编辑的WFS层。我无法正常工作。完全不显示。这是我的代码,有什么建议吗?我尝试了很多变化。没有一个起作用。

wfs = new OpenLayers.Layer.Vector("Editable Features", {
    strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
    projection: new OpenLayers.Projection("EPSG:4326"),
    protocol: new OpenLayers.Protocol.WFS({
        version: "1.0.0",
        url: ".../geoserver/wfs",
        featurePrefix: "newdata",
        featureType: "missouri_building",
        featureNS: "...:8080/newdata",
        geometryName: "geom",
        srsName: "EPSG:4326",

    })
});

这是同一层的WMS版本,在此层工作正常。

var saveStrategy = new OpenLayers.Strategy.Save();
var missouri_building = new OpenLayers.Layer.WMS(
    "new",
    "...:8080/geoserver/wms", {
        layers: 'newdata:missouri_building',
        transparent: 'true',

        format: 'image/png'
    }
);

我还能够通过QGIS中的WFS连接和编辑图层。这是QGIS- srsname='EPSG:4326' typename='newdata:missouri_building' url='.../geoserver/newdata/ows?' version='1.0.0' table="" sql=

中的图层源

0 个答案:

没有答案