Closed Sid775 closed 4 days ago
Hi @Sid775, Thanks for the report! It would be great if you could confirm whether v7 (pinned, not v7.0.1) has the desired behaviour, and whether opacity affects the result (on v7.0.1 and v7).
Hi @JaffaKetchup,
Thanks for fast response!
Pinned version 7.0.0 like this: flutter_map: 7.0.0
and tried both cases.
Pretty the same picture.
Opacity Is not affects it, pretty the same problems. Case one:
Case two:
Also, on version 7.0.1 same code does not render holes at all:
It's only help to use parameter useAltRendering
, then in first case "hole" outside of polygon(first case) disappears, but, hole inside polygon (second case) is strange. I think it's related to issue #1899.
Thanks for testing! I believe the reason holes aren't shown in v7.0.1 is because it requires the points to be in a certain winding direction. Can you try reversing the hole points?
You are right, changing sequence of coordinates to this:
holePointsList: [
[
LatLng(51.024223, 4.483965), //3
LatLng(51.028613, 4.483917), //2
LatLng(51.028643, 4.478061), //1
LatLng(51.024254, 4.477917), //4
],
[
LatLng(51.023103, 4.482717), //3
LatLng(51.025404, 4.482141), //2
LatLng(51.025434, 4.474413), //1
LatLng(51.023224, 4.477485), //4
]
]
but result the same:
Opacity still not affects anything
Requires reverification on v7.0.2. May be fixed by #1925.
I believe this could be considered the correct behaviour, however it is not well documented and a little unexpected. However, there could be considered a bug in that the alternative renderer does not handle this in the same way: it gives results closer to what you were expecting.
If you need to manipulate polygons to merge them toegther, which should avoid holes cutting into each other, you can try using polybool.
For now, I'm going to mark this as low priority.
What is the bug?
My case is polygon with a lot of holes, it two corner case that I found, based on same problem in code, I believe, please correct me if I'm wrong and it working as designed. First case: is when I try to make hole in polygon but coordinates of this hole places outside of polygon. I expect that hole in this case will be ignored but it appears part of polygon there.
Second case: is when I try to make holes in polygon that overlaps. I expect that holes will not affect each other or will merge but second hole create part of polygon in first hole.
How can we reproduce it?
To reproduce First case:
To reproduce Second case: