简体   繁体   中英

Openlayers 3 z-ordering of features

I have a vector layer, which contains polygons and points loaded from GEOJSON source. It looks to me, points are always positioned above polygons regardless of their order in source GEOJSON file. See an example definition below. Is there a way, how to position points below polygons on the same layer?

The example:

Points are styled as white and red circle. Polygon is gray.

在此处输入图片说明

My GEOJSON looks like this (I even tried to reverse features order in the file):

{
    "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。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM