0
查看dev.openlayers.org/apidocs/files/OpenLayers/Layer/Vector-js.htm之後 - 不清楚如何從geojson中提取屬性值下面的實施例,使用以下的javascript:從OpenLayers.Layer.Vector對象中檢索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()
}),
});
我所知到目前爲止的方式是,層是具有含「屬性」爲特徵類型的屬性的對象。但不知道如何訪問它。
任何幫助,將不勝感激。提前致謝!