Migrating To v4
This update brings major breaking changes for all users.
We apologise for any difficulty this may cause and time you may spend migrating.
However, this update is a part of our aim to simplify this library, and should improve stability, readability, and performance for you in the long term. In addition, this will make the library much easier to maintain and add new functionality to through plugins and future features.
Please refer to the sections below for information on how to migrate your project. This will contain the changes that most users may need to make, but not all changes.
For a full list of changes, please see the full CHANGELOG, and make use of the old and new API reference.
One of the major cores of flutter_map has been upgraded to the 21st century by a generous contributor (@rorystephenson). This increases the simplicity of the layer, and its performance!
The following properties have been removed:
updateInterval
tileFadeInDuration
tileFadeInStart
tileFadeInStartWhenOverride
overrideTilesWhenUrlChanges
fastReplace
... and replaced with
tileDisplay
(TileDisplay
) & tileUpdateTransformer
(StreamTransformer<TileUpdateEvent, TileUpdateEvent>
).There is no "one size fits all" available for this migration: you'll need to experiment to find a combination of the two that work. Read the in-code API documentation for more information about what each one does.
Grey boxes get a little boring, don't you think? We think so as well, so we've developed a new interactive animated attribution layer that should cover all your needs.
To migrate, replace with
SimpleAttributionWidget
and fill properties as necessary - see the in-code API documentation.Alternatively, consider implementing attribution using RichAttributionWidget to take advantage of the new interactive, animated layer.
Setting this to
false
was equivalent to disabling drag gestures through interactiveFlags
.To migrate plugin code, use
onVerticalDrag
and onHorizontalDrag
updates instead of onPan
. For more information, see https://github.com/fleaflet/flutter_map/pull/1455.CustomPoints
previously used num
as their generic type, which lead to type casting within FM and plugins, as some code only allowed int
/double
, not num
.Many of these have been updated to reflect their true usage.
To migrate, look for any methods which now take a different generic typed
CustomPoint
than was previously required. These should then be either casted at this location, or the source of the number should more accuratley represent what the number will be.Last modified 22d ago