【问题标题】:OpenLayers WFS with array of featureType shows just one featureType具有特征类型数组的 OpenLayers WFS 仅显示一个特征类型
【发布时间】:2011-12-17 23:57:42
【问题描述】:

我有 2 层的 WFS 服务,并希望在一个矢量层中显示这两个层:

var layer = new OpenLayers.Layer.Vector('test', {
    styleMap: style,
    strategies: [new OpenLayers.Strategy.BBOX()],
    projection: new OpenLayers.Projection('EPSG:4326'),
    protocol: new OpenLayers.Protocol.WFS({
        version: '1.1.0',
        srsName: 'EPSG:4326',
        url: 'http://XXX/WFSServer?request=GetFeature&typeName=pref:type1,pref:type2',
        featureType: ['type1', 'type2'],
        singleFeatureType: false,
        featurePrefix: 'pref',
        geometryName: 'Shape',
        readFormat: new OpenLayers.Format.GML.v3({ xy: false })
    })
});

OpenLayers 只显示 pref:type1

我在配置中缺少什么? 谢谢。

【问题讨论】:

  • 你试过我的建议了吗?有什么反馈吗?

标签: gis openlayers


【解决方案1】:

我认为您过度指定了网址。我会将其设置为

http://XXX/WFSServer

并让 OL 根据您的参数创建请求。

this example比较

【讨论】:

  • 我可以验证这是正确的方法。让 OpenLayers 构建整个请求,否则您将获得不一致的行为。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-06-19
  • 2021-12-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多