查看 dev.openlayers.org/apidocs/files/OpenLayers/Layer/Vector-js.htm 后 - 不清楚如何使用以下 javascript 从下面的 geojson 示例中提取属性值:
{ "type": "FeatureCollection",
"features": [
{ "type": "Feature",
"geometry":
{ "type": "MultiPoint",
"coordinates": [[[0,0]]]
},
"properties": {"test" : "this"}
}
]
}
layer = new OpenLayers.Layer.Vector("GML", {
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "some_url",
params: {...},
format: new OpenLayers.Format.GeoJSON()
}),
});
到目前为止,我理解它的方式是 layer 是一个包含“属性”作为特征类型属性的对象。但不确定如何访问它。
任何帮助,将不胜感激。提前致谢!