diff --git a/CHANGELOG.md b/CHANGELOG.md index 493bf182d..0be94b618 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,29 @@ Please consider [donating](https://github.com/sponsors/fleaflet) or [contributin This CHANGELOG does not include every commit and/or PR - it is a hand picked selection of the ones that have an effect on most users. For a full list of changes, please check the GitHub repository releases/tags. We also release highlights for some releases on the docs site. +## [8.3.1] - 2026/07/xx + +Contains the following user-affecting bug fixes: + +- Revert [#2182](https://github.com/fleaflet/flutter_map/pull/2182) to fix multiple internal errors - [#2218](https://github.com/fleaflet/flutter_map/pull/2218) for [#2199](https://github.com/fleaflet/flutter_map/issues/2199) +- Prevent memory leak and crash when `Marker`s with NaN coordinates provided - [#2213](https://github.com/fleaflet/flutter_map/pull/2213) for [#2178](https://github.com/fleaflet/flutter_map/issues/2178) + +Contains the following user-affecting performance improvements: + +- Improve `MarkerLayer` performance by caching projections - [#2213](https://github.com/fleaflet/flutter_map/pull/2213) +- Improve `PolygonLayer` performance, particularly for polygons with holes - [#2211](https://github.com/fleaflet/flutter_map/pull/2211) +- Improve `PolylineLayer` performance by improving culling algorithm - [#2212](https://github.com/fleaflet/flutter_map/pull/2212) + +Contains the following other notable changes: + +- Support 'pkg:latlong2' v0.10.x dependency - [#2207](https://github.com/fleaflet/flutter_map/pull/2207) + +Many thanks to these contributors (in no particular order): + +- @ThexXTURBOXx +- @ben-milanko +- ... and all the maintainers + ## [8.3.0] - 2026/04/14 Contains the following user-affecting changes: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 179dd623c..30d35e024 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,3 +17,7 @@ We rely on a standardized process and procedure to ensure top-quality releases. * **Use a clear (preferably [Conventional](https://www.conventionalcommits.org/)) PR title.** This makes it easier for us to group commits for release and write correct CHANGELOGs. + +* **Using AI?** +If you're using AI in any way to write code or otherwise assist you, please let us know in the PR description. +If the code is of insufficient quality, it will be rejected. Human submitters take all responsibility for their code. diff --git a/example/lib/misc/tile_providers.dart b/example/lib/misc/tile_providers.dart index 5419b7425..5a5f25914 100644 --- a/example/lib/misc/tile_providers.dart +++ b/example/lib/misc/tile_providers.dart @@ -7,6 +7,6 @@ final httpClient = RetryClient(Client()); // TODO: This causes unneccessary rebuilding TileLayer get openStreetMapTileLayer => TileLayer( urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', - userAgentPackageName: 'dev.fleaflet.flutter_map.example', + userAgentPackageName: 'dev.fleaflet.flutter_map.demo', tileProvider: NetworkTileProvider(httpClient: httpClient), ); diff --git a/example/pubspec.lock b/example/pubspec.lock index 28720b875..50adcec9a 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -29,10 +29,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" clock: dependency: transitive description: @@ -124,7 +124,7 @@ packages: path: ".." relative: true source: path - version: "8.2.2" + version: "8.3.0" flutter_test: dependency: "direct dev" description: flutter @@ -207,22 +207,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.0.0" - logger: - dependency: transitive - description: - name: logger - sha256: "55d6c23a6c15db14920e037fe7e0dc32e7cdaf3b64b4b25df2d541b5b6b81c0c" - url: "https://pub.dev" - source: hosted - version: "2.6.1" matcher: dependency: transitive description: name: matcher - sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6" + sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd" url: "https://pub.dev" source: hosted - version: "0.12.18" + version: "0.12.20" material_color_utilities: dependency: transitive description: @@ -235,10 +227,10 @@ packages: dependency: transitive description: name: meta - sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + sha256: c82594181e3312f3d0695fc95aaaf7758d75b8d4ae2bbecf223b9fd5109a059d url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.18.3" mgrs_dart: dependency: transitive description: @@ -456,10 +448,10 @@ packages: dependency: transitive description: name: test_api - sha256: "19a78f63e83d3a61f00826d09bc2f60e191bf3504183c001262be6ac75589fb8" + sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11" url: "https://pub.dev" source: hosted - version: "0.7.8" + version: "0.7.12" typed_data: dependency: transitive description: @@ -552,10 +544,10 @@ packages: dependency: transitive description: name: vector_math - sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + sha256: "1d774bbdf6b72a0b12122fc1560c9c2d2a67db5a4a4cc2bd8a5c990ab20e3188" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.0" vm_service: dependency: transitive description: @@ -589,5 +581,5 @@ packages: source: hosted version: "1.1.0" sdks: - dart: ">=3.9.0 <4.0.0" + dart: ">=3.10.0 <4.0.0" flutter: ">=3.35.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 1d6196f59..2135861ce 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_map_example description: Example application for 'flutter_map' package publish_to: "none" -version: 8.3.0 +version: 8.3.1 environment: sdk: ">=3.6.0 <4.0.0" diff --git a/lib/src/layer/polyline_layer/polyline_layer.dart b/lib/src/layer/polyline_layer/polyline_layer.dart index 6da20ffc5..a705802b6 100644 --- a/lib/src/layer/polyline_layer/polyline_layer.dart +++ b/lib/src/layer/polyline_layer/polyline_layer.dart @@ -208,15 +208,11 @@ class _PolylineLayerState extends State> continue; } + final projectedBounds = projectedPolyline.boundingBox; + /// Returns true if the points stretch on different versions of the world. - bool stretchesBeyondTheLimits() { - for (final point in projectedPolyline.points) { - if (point.dx > xEast || point.dx < xWest) { - return true; - } - } - return false; - } + bool stretchesBeyondTheLimits() => + projectedBounds.right > xEast || projectedBounds.left < xWest; // TODO: think about how to cull polylines that go beyond -180/180. // As the notions of projected west/east as min/max are not reliable. @@ -235,6 +231,16 @@ class _PolylineLayerState extends State> // when none of the line is visible. Here, focusing on longitudes. if (!isOverlappingLongitude()) continue; + // Fast path: when the whole polyline is visible there is nothing to + // cull, so skip the per-segment scan (and its sublist allocations). + if (projBounds.left <= projectedBounds.left && + projBounds.top <= projectedBounds.top && + projBounds.right >= projectedBounds.right && + projBounds.bottom >= projectedBounds.bottom) { + yield projectedPolyline; + continue; + } + // pointer that indicates the start of the visible polyline segment int start = -1; bool containsSegment = false; diff --git a/lib/src/layer/polyline_layer/projected_polyline.dart b/lib/src/layer/polyline_layer/projected_polyline.dart index 49707db41..bc57c2f8e 100644 --- a/lib/src/layer/polyline_layer/projected_polyline.dart +++ b/lib/src/layer/polyline_layer/projected_polyline.dart @@ -5,10 +5,15 @@ class _ProjectedPolyline with HitDetectableElement { final Polyline polyline; final List points; + /// Bounding box of [points], in projected space (cached) + /// + /// Computed lazily: culled fragments never use it. + late final Rect boundingBox = RectExtension.containing(points); + @override R? get hitValue => polyline.hitValue; - const _ProjectedPolyline._({ + _ProjectedPolyline._({ required this.polyline, required this.points, }); diff --git a/pubspec.yaml b/pubspec.yaml index a969a06da..ae7eb7ada 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_map description: "Flutter's №1 non-commercially aimed map client: it's easy-to-use, versatile, vendor-free, fully cross-platform, and 100% pure-Flutter" -version: 8.3.0 +version: 8.3.1 repository: https://github.com/fleaflet/flutter_map issue_tracker: https://github.com/fleaflet/flutter_map/issues diff --git a/windowsApplicationInstallerSetup.iss b/windowsApplicationInstallerSetup.iss index b896f67ba..b2b526741 100644 --- a/windowsApplicationInstallerSetup.iss +++ b/windowsApplicationInstallerSetup.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "flutter_map Demo" -#define MyAppVersion "for 8.3.0" +#define MyAppVersion "for 8.3.1" #define MyAppPublisher "fleaflet" #define MyAppURL "https://github.com/fleaflet/flutter_map" #define MyAppSupportURL "https://github.com/fleaflet/flutter_map/issues"