0

我想与 Geoserver 建立连接以通过 WFS-T 编辑图层的多个点。我从不同的例子开始尝试这个,但地图没有可视化这些点。我有一个通过 WMS 公开的 openstreetmap 基础层。服务器用我要求的点记录呼叫......这是我正在拨打的电话:

var wfs_layer = new OpenLayers.Layer.Vector("Editable Features", {
                 strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
                 protocol: new OpenLayers.Protocol.Script({
                           url: "http://192.168.0.10:8080/geoserver/wfs",
                           params: {
                                   service: "WFS",
                                   version: "1.0.0",
                                   srsName: "EPSG:3004",
                                   request: "GetFeature",
                                   typeName: "Incendi:inc2008",
                                   outputFormat: "gml3"
                           },
                  filterToParams: function(filter, params) {
                    // example to demonstrate BBOX serialization
                    if (filter.type === OpenLayers.Filter.Spatial.BBOX) {
                        params.bbox = filter.value.toArray();
                        if (filter.projection) {
                            params.bbox.push(filter.projection.getCode());
                        }
                    }
                    return params;
                 }
                 })
 });

提前感谢您的回复

4

1 回答 1

0

由跨域 javascript 的限制引起的。我需要使用主机来启用来自远程服务器的 WFS 调用。

于 2012-02-15T11:58:04.610 回答