mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Unexpected results from overlapping polygons

Open farseekers opened this issue 1 year ago • 0 comments

mapbox-gl-js version: 3.7.0

browser: Google Chrome 130

Steps to Trigger Behavior

Create a map instance with a filled Polygon containing three sets of coordinates.

  1. The entire world - [[180, 90], [-180, 90], [-180, -90], [180, -90]]
  2. A triangle - [[149.4, -37.3], [152.5, -32.1], [150.1, -32.6]]
  3. A triangle within the previous one - [[151, -32.8], [151.5, -32.8], [152, -32.6]]

Link to Demonstration

https://codepen.io/farseekers/pen/abeWNVz

Expected Behavior

I acknowledge there might be different interpretations of whether the inner triangle should be filled or not, but I expect the corners of the resulting shapes to be limited to the supplied points.

Actual Behavior

At a certain zoom level, there is a triangle that seems unrelated to any of the input points. I've used markers to indicate the input points.

demo

farseekers avatar Oct 16 '24 22:10 farseekers