🚀What's New In v8.2?
Overview
Here's some highlights since v8.0:
Automatically enabled lightweight built-in caching & aborting of in-flight HTTP requests for obsolete tiles
The NetworkTileProvider
has had a massive functionality boost!
Built-in caching helps you, your users, and the tile server, and is enabled by default for maximum ease. You could also switch it out with a custom implementation, or disable it altogether if you prefer. Find out more in Caching.
You may be using the CancellableNetworkTileProvider
, which allowed in-flight HTTP requests to be aborted when the tiles would no longer be displayed, helping to improve performance and usability. Unfortunately, it isn't compatible with built-in caching. Fortunately, it's also been deprecated - its functionality is now available in the core! 'package:http' v1.5.0-beta (#1773) supports aborting requests with the 3 default clients natively, so Dio is no longer required. This makes it easier for you and for us!
Inverted filling for PolygonLayer
& multi-yet-single world support for Poly*Layer
PolygonLayer
& multi-yet-single world support for Poly*Layer
This continues the work on multi-world support (thanks monsieurtanuki), and fixes an issue that occured where users used a Polygon
covering the entire world, with holes as cut outs.
This feature was bounty-funded, thanks to our generous Supporters, and the community! We hope to open more bounties in future.
No more grey background at the North and South edges of your map (optionally)
Thanks to the community, a new ContainCameraLatitude
CameraConstraint
is available, which keeps just the world in view at all times. At the moment, it still needs enabling manually.
Check out the effect in our demo for multi-world functionality. You can enable it in your project just by passing CameraConstraint.containLatitude()
to the MapOptions.cameraConstraint
option.
Polygon label placement improvements
This is split into 3 parts:
The old method of picking a placement algorithm has been deprecated and been replaced with a new, extensible system - it's still just as easy to use as the old one
Thanks to the community, a new placement algorithm has been added: an improved centroid algorithm using the 'signed area centroid' algorithm - this is the new default, but the old algorithm is still available
The polylabel placement algorithm has been given a fresh lick of paint and uses a more modern Dart implementation to improve performance and customizability
See how to migrate to the new system below.
Documentation improvements
This documentation has also had a bit of a renewal!
Follow the new guide to setup a
TileLayer
as we recommend: Recommended Setup. More to come soon!The guide for interactive layers has been simplified, reworked, and example added. Check it out: Layer Interactivity.
We've added some information about using flutter_map with the OpenStreetMap public tile servers: Using OpenStreetMap (direct).
Information will appear in console when a TileLayer
is loaded using one of the OpenStreetMap tile servers (in debug mode)
TileLayer
is loaded using one of the OpenStreetMap tile servers (in debug mode)Additionally, where an appropriate User-Agent header (which identifies your app to the server) is not set - for example, through TileLayer.userAgentPackageName
, or directly through the tile provider's HTTP headers configuration - a warning will appear in console (in debug mode), advising you to set a UA.
In future, we may block users which do not set a valid UA identifier for this server.
For more information, see Using OpenStreetMap (direct).
That's already a lot, but it's only scratching the surface. Alongside the community, we've improved our example app, reduced the size of our demo & package, - not even to mention the multiple bug fixes and other performance improvements.
Why not check out the CHANGELOG for the full list of curated changes, and the full commit and contributor listing if you like all the details:
Migration
To v8.2
v8.2 doesn't contain any API breaking changes, but it does contain deprecations and a small change in potential display output - we suggest preparing for the next breaking release whenever you can
To v8.0
Migrating to v8 should be pain-free for most apps, but some major changes are likely for plugins.
Some breaking changes have been made. The amount of migration required will depend on how much your project uses more advanced functionality. Basic apps are unlikely to require migration.
Last updated
Was this helpful?