我正在尝试从GeoJSON文件中读取各个要素的样式属性,并在“打开图层3”中显示相同的属性。 GeoJSON似乎有效,但样式没有反映在显示中。
我们如何从Open Layers 3中的GeoJSON文件中读取每个特征的个别风格?
提前致谢
我的GeoJSON文件为
{"type": "FeatureCollection","crs":
{ "type": "name", "properties":
{ "name":"urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [{ "type": "Feature","id": "abc","properties":{"name":"object1"},"geometry": { "type": "LineString", "coordinates":[[17.0,67],[20.0,90.0]]},
"style":
{
"stroke" : "#ff0000",
"stroke-width": "3"
}
}]}