flutter_map_animations

Creator: coderz1093

Last updated:

Add to Cart

Description:

flutter map animations

Flutter Map Animations #

Animation utility for the flutter_map package.
Try the example app
Table of Contents #

Documentation

AnimatedMapController

Animated Movement


AnimatedMarkerLayer & AnimatedMarker


Migration Guide

v0.5.0
v0.4.0


Contributors

Documentation #
AnimatedMapController #
Just create an AnimatedMapController and you're good to go:
class _MyWidgetState extends State<MyWidget> with TickerProviderStateMixin {
late final _animatedMapController = AnimatedMapController(vsync: this);

// ...
}
copied to clipboard
You can specify the animation duration and curve:
AnimatedMapController(
vsync: this,
duration: const Duration(milliseconds: 500),
curve: Curves.easeInOut,
);
copied to clipboard
And add it to your FlutterMap widget:
FlutterMap(
mapController: _animatedMapController.mapController,
// ...
)
copied to clipboard
Animated Movement #



Rotation
Zoom
Center on point










Check the AnimatedMapController API for more!
AnimatedMarkerLayer & AnimatedMarker #



AnimatedMarker








FlutterMap(
mapController: _animatedMapController.mapController,
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'com.example.app',
),
AnimatedMarkerLayer(
markers: [
AnimatedMarker(
point: LatLng(51.509364, -0.128928),
builder: (_, animation) {
final size = 50.0 * animation.value;
return Icon(
Icons.location_on,
size: size,
);
},
),
],
),
],
)
copied to clipboard
Migration Guide #
v0.5.0 #
With flutter_map v6 some parameters have been removed or renamed:

AnimatedMarker.rotateOrigin, AnimatedMarker.anchorPos have been removed
AnimatedMarker.rotateAlignment has been renamed to AnimatedMarker.alignment
AnimatedMarkerLayer.rotateOrigin, AnimatedMarkerLayer.anchorPos have been removed
AnimatedMarkerLayer.rotateAlignment has been renamed to AnimatedMarkerLayer.alignment

v0.4.0 #

With flutter_map v5 it's not possible anymore to extend MapControllerImpl which was used to use the AnimatedMapController directly as a MapController in the FlutterMap widget. Now an instance of MapController is created internally or can be passed as a parameter to the AnimatedMapController constructor. You can access it with the mapController getter:

late final _animatedMapController = AnimatedMapController(vsync: this);

@override
Widget build(BuildContext context) {
return FlutterMap(
mapController: _animatedMapController.mapController,
// ...
);
}
copied to clipboard
Contributors #







Guillaume Roux






Luka S






Rory Stephenson






Reinis Sprogis

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.