gpt4 book ai didi

javascript - Openlayers 3 功能的 z 排序

转载 作者:行者123 更新时间:2023-11-29 21:14:48 25 4
gpt4 key购买 nike

我有一个矢量图层,其中包含从 GEOJSON 源加载的多边形和点。在我看来,无论它们在源 GEOJSON 文件中的顺序如何,点总是位于多边形上方。请参阅下面的示例定义。有没有办法,如何在同一层上将点定位在多边形下方?

例子:

点的样式为白色和红色圆圈。多边形是灰色的。

enter image description here

我的 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。

关于javascript - Openlayers 3 功能的 z 排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39875364/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com