fleaflet / flutter_map

A versatile mapping package for Flutter. Simple and easy to learn, yet completely customizable and configurable, it's the best choice for mapping in your Flutter app.
https://pub.dev/packages/flutter_map
BSD 3-Clause "New" or "Revised" License
2.68k stars 848 forks source link

[BUG] `Polygon` update detection doesn't detect changes to `holePointsList` #1912

Closed JaffaKetchup closed 5 days ago

JaffaKetchup commented 3 weeks ago

What is the bug?

When updating the holePointsList, and not points of a Polygon, the new algorithm does not detect the change.

How can we reproduce it?

-

Do you have a potential solution?

The issue is that the holePointsList is not checked in the hashCode, whilst it is checked in the equality operator. Additionally, the equality operator does not check for deep equality for holePointsList, which would fit better with the surrounding list equality check.

The new algorithm uses the Polygon.hashCode as int keys of a SplayTreeMap. It does not use a HashMap, to try to reduce memory consumption.

Platforms

All

Severity

Obtrusive: Prevents normal functioning but causes no errors in the console