我有2层WFS服务,想要在一个Vector层中显示两个层:
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
配置中缺少什么? 谢谢。