Openlayers 3 功能的 z 排序
Openlayers 3 z-ordering of features
我有一个矢量图层,其中包含从 GEOJSON 源加载的多边形和点。在我看来,无论它们在源 GEOJSON 文件中的顺序如何,点总是位于多边形上方。请参阅下面的示例定义。有没有办法,如何在同一层上将点定位在多边形下方?
例子:
点的样式为白色和红色圆圈。多边形是灰色的。
我的 GEOJSON 看起来像这样(我什至试图颠倒文件中的功能顺序):
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"radius": "1000"
},
"geometry": {
"type": "Point",
"coordinates": [
12.4,
50.08333
]
}
},
{
"type": "Feature",
"properties": {
"radius": "800"
},
"geometry": {
"type": "Point",
"coordinates": [
12.4,
50.08333
]
}
},
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[
[
12.4,
50.08333
],
...........
在样式对象中使用 zIndex。
我有一个矢量图层,其中包含从 GEOJSON 源加载的多边形和点。在我看来,无论它们在源 GEOJSON 文件中的顺序如何,点总是位于多边形上方。请参阅下面的示例定义。有没有办法,如何在同一层上将点定位在多边形下方?
例子:
点的样式为白色和红色圆圈。多边形是灰色的。
我的 GEOJSON 看起来像这样(我什至试图颠倒文件中的功能顺序):
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"radius": "1000"
},
"geometry": {
"type": "Point",
"coordinates": [
12.4,
50.08333
]
}
},
{
"type": "Feature",
"properties": {
"radius": "800"
},
"geometry": {
"type": "Point",
"coordinates": [
12.4,
50.08333
]
}
},
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[
[
12.4,
50.08333
],
...........
在样式对象中使用 zIndex。