Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue rendering fill layers above symbol layers #1063

Closed
orangemug opened this issue Dec 18, 2023 · 2 comments · Fixed by openlayers/openlayers#15466
Closed

Issue rendering fill layers above symbol layers #1063

orangemug opened this issue Dec 18, 2023 · 2 comments · Fixed by openlayers/openlayers#15466

Comments

@orangemug
Copy link
Contributor

Rendering of fill layers above symbol layers doesn't appear to work correctly.

maplibre
Screenshot from 2023-12-18 11-53-12

ol-mapbox-style latest SHA bd5fe28b82071ad1da8e5996f5bd491c2aa1156b
Screenshot from 2023-12-18 11-52-58

Example style.json
{
  "version": 8,
  "name": "test",
  "metadata": {
    "description": "basic"
  },
  "sources": {
    "points": {
      "data": {
        "type": "FeatureCollection",
        "crs": {
          "type": "name",
          "properties": {
            "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
          }
        },
        "features": [{
          "type": "Feature",
          "properties": {
            "n": 2,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [0.5, 0.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 3,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [0.5, 1.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 4,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [0.5, 2.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 5,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [0.5, 3.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 6,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [0.5, 4.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 7,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [0.5, 5.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 8,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [0.5, 6.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 9,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [0.5, 7.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 10,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [0.5, 8.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 11,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [0.5, 9.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 12,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [1.5, 0.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 13,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [1.5, 1.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 14,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [1.5, 2.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 15,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [1.5, 3.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 16,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [1.5, 4.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 17,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [1.5, 5.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 18,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [1.5, 6.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 19,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [1.5, 7.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 20,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [1.5, 8.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 21,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [1.5, 9.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 22,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [2.5, 0.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 23,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [2.5, 1.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 24,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [2.5, 2.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 25,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [2.5, 3.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 26,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [2.5, 4.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 27,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [2.5, 5.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 28,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [2.5, 6.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 29,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [2.5, 7.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 30,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [2.5, 8.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 31,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [2.5, 9.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 32,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [3.5, 0.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 33,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [3.5, 1.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 34,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [3.5, 2.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 35,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [3.5, 3.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 36,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [3.5, 4.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 37,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [3.5, 5.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 38,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [3.5, 6.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 39,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [3.5, 7.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 40,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [3.5, 8.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 41,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [3.5, 9.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 42,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [4.5, 0.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 43,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [4.5, 1.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 44,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [4.5, 2.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 45,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [4.5, 3.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 46,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [4.5, 4.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 47,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [4.5, 5.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 48,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [4.5, 6.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 49,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [4.5, 7.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 50,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [4.5, 8.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 51,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [4.5, 9.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 52,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [5.5, 0.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 53,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [5.5, 1.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 54,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [5.5, 2.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 55,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [5.5, 3.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 56,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [5.5, 4.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 57,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [5.5, 5.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 58,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [5.5, 6.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 59,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [5.5, 7.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 60,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [5.5, 8.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 61,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [5.5, 9.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 62,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [6.5, 0.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 63,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [6.5, 1.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 64,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [6.5, 2.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 65,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [6.5, 3.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 66,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [6.5, 4.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 67,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [6.5, 5.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 68,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [6.5, 6.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 69,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [6.5, 7.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 70,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [6.5, 8.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 71,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [6.5, 9.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 72,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [7.5, 0.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 73,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [7.5, 1.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 74,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [7.5, 2.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 75,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [7.5, 3.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 76,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [7.5, 4.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 77,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [7.5, 5.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 78,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [7.5, 6.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 79,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [7.5, 7.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 80,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [7.5, 8.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 81,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [7.5, 9.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 82,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [8.5, 0.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 83,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [8.5, 1.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 84,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [8.5, 2.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 85,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [8.5, 3.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 86,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [8.5, 4.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 87,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [8.5, 5.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 88,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [8.5, 6.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 89,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [8.5, 7.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 90,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [8.5, 8.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 91,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [8.5, 9.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 92,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [9.5, 0.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 93,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [9.5, 1.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 94,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [9.5, 2.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 95,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [9.5, 3.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 96,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [9.5, 4.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 97,
            "cat": 1
          },
          "geometry": {
            "type": "Point",
            "coordinates": [9.5, 5.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 98,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [9.5, 6.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 99,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [9.5, 7.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 100,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [9.5, 8.5]
          }
        }, {
          "type": "Feature",
          "properties": {
            "n": 101,
            "cat": 2
          },
          "geometry": {
            "type": "Point",
            "coordinates": [9.5, 9.5]
          }
        }]
      },
      "type": "geojson"
    },
    "polygons": {
      "type": "geojson",
      "data": {
        "type": "FeatureCollection",
        "features": [
          {
            "type": "Feature",
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    0,
                    0
                  ],
                  [
                    1,
                    0
                  ],
                  [
                    1,
                    1
                  ],
                  [
                    0,
                    1
                  ],
                  [
                    0,
                    0
                  ]
                ]
              ]
            },
            "properties": {
              "color": "blue",
              "zIndex": 0
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    0.1,
                    0.1
                  ],
                  [
                    1.1,
                    0.1
                  ],
                  [
                    1.1,
                    1.1
                  ],
                  [
                    0.1,
                    1.1
                  ],
                  [
                    0.1,
                    0.1
                  ]
                ]
              ]
            },
            "properties": {
              "color": "red",
              "zIndex": 1
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    0.2,
                    0.2
                  ],
                  [
                    1.2,
                    0.2
                  ],
                  [
                    1.2,
                    1.2
                  ],
                  [
                    0.2,
                    1.2
                  ],
                  [
                    0.2,
                    0.2
                  ]
                ]
              ]
            },
            "properties": {
              "color": "blue",
              "zIndex": 0
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    0.30000000000000004,
                    0.30000000000000004
                  ],
                  [
                    1.3,
                    0.30000000000000004
                  ],
                  [
                    1.3,
                    1.3
                  ],
                  [
                    0.30000000000000004,
                    1.3
                  ],
                  [
                    0.30000000000000004,
                    0.30000000000000004
                  ]
                ]
              ]
            },
            "properties": {
              "color": "red",
              "zIndex": 1
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    0.4,
                    0.4
                  ],
                  [
                    1.4,
                    0.4
                  ],
                  [
                    1.4,
                    1.4
                  ],
                  [
                    0.4,
                    1.4
                  ],
                  [
                    0.4,
                    0.4
                  ]
                ]
              ]
            },
            "properties": {
              "color": "blue",
              "zIndex": 0
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    0.5,
                    0.5
                  ],
                  [
                    1.5,
                    0.5
                  ],
                  [
                    1.5,
                    1.5
                  ],
                  [
                    0.5,
                    1.5
                  ],
                  [
                    0.5,
                    0.5
                  ]
                ]
              ]
            },
            "properties": {
              "color": "red",
              "zIndex": 1
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    0.6000000000000001,
                    0.6000000000000001
                  ],
                  [
                    1.6,
                    0.6000000000000001
                  ],
                  [
                    1.6,
                    1.6
                  ],
                  [
                    0.6000000000000001,
                    1.6
                  ],
                  [
                    0.6000000000000001,
                    0.6000000000000001
                  ]
                ]
              ]
            },
            "properties": {
              "color": "blue",
              "zIndex": 0
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    0.7000000000000001,
                    0.7000000000000001
                  ],
                  [
                    1.7000000000000002,
                    0.7000000000000001
                  ],
                  [
                    1.7000000000000002,
                    1.7000000000000002
                  ],
                  [
                    0.7000000000000001,
                    1.7000000000000002
                  ],
                  [
                    0.7000000000000001,
                    0.7000000000000001
                  ]
                ]
              ]
            },
            "properties": {
              "color": "red",
              "zIndex": 1
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    0.8,
                    0.8
                  ],
                  [
                    1.8,
                    0.8
                  ],
                  [
                    1.8,
                    1.8
                  ],
                  [
                    0.8,
                    1.8
                  ],
                  [
                    0.8,
                    0.8
                  ]
                ]
              ]
            },
            "properties": {
              "color": "blue",
              "zIndex": 0
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    0.9,
                    0.9
                  ],
                  [
                    1.9,
                    0.9
                  ],
                  [
                    1.9,
                    1.9
                  ],
                  [
                    0.9,
                    1.9
                  ],
                  [
                    0.9,
                    0.9
                  ]
                ]
              ]
            },
            "properties": {
              "color": "red",
              "zIndex": 1
            }
          }
        ]
      }
    },
    "osm": {
      "type": "raster",
      "attribution": "&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors.",
      "tileSize": 256,
      "tiles": [
        "https://a.tile.openstreetmap.org/{z}/{x}/{y}.png",
        "https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",
        "https://c.tile.openstreetmap.org/{z}/{x}/{y}.png"
      ]
    }
  },
  "sprite": "https://maputnik.github.io/osm-liberty/sprites/osm-liberty",
  "glyphs": "https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf",
  "layers": [
    {
      "id": "bg",
      "type": "background"
    },
    {
      "id": "raster",
      "type": "raster",
      "source": "osm"
    },
    {
      "source": "points",
      "type": "symbol",
      "id": "testing123",
      "layout": {
        "icon-image": "zoo"
      },
      "paint": {
        "icon-halo-color": "#fff",
        "icon-halo-width": 1
      }
    },
    {
      "id": "test1",
      "type": "fill",
      "source": "polygons",
      "paint": {
        "fill-color": "red"
      }
    },
    {
      "id": "test2",
      "type": "fill",
      "source": "polygons",
      "paint": {
        "fill-color": "blue"
      }
    }
  ],
  "id": 9
}
@ahocevar
Copy link
Member

This is due to the way decluttering is set up. Decluttered items will always be rendered on top of everything else.

@orangemug
Copy link
Contributor Author

Ah I see, thanks

From README.md

Declutter images and text. Decluttering is applied to all image and text styles of all Vector and VectorTile layers that have set this to true. The priority is defined by the z-index of the layer, the zIndex of the style and the render order of features. Higher z-index means higher priority. Within the same z-index, a feature rendered before another has higher priority.

As an optimization decluttered features from layers with the same className are rendered above the fill and stroke styles of all of those layers regardless of z-index. To opt out of this behavior and place declutterd features with their own layer configure the layer with a className other than ol-layer.

It's probably worth also mentioning this in terms of the mapbox-gl-js spec. Maybe there could be a "where we diverge from spec/maplibre-gl/mapbox-gl" as a part of #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants