flutter_map_compass

A simple compass for flutter_map. It shows the rotation of the map and resets the rotation back to 0 when tapped.

Pub Version likes Pub Points Pub Popularity

GitHub last commit stars GitHub issues codecov

Example screenshot

Getting started

Add the following packages to your pubspec.yaml file:

dependencies:
  flutter_map: ^6.0.0         # in case you don't have it yet 
  flutter_map_compass: ^1.0.0 # this package

Usage

@override
Widget build(BuildContext context) {
  return FlutterMap(
    options: MapOptions(),
    children: [
      TileLayer(
        urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
      ),

      // use the default compass that is based on the cupertino compass icon
      const MapCompass.cupertino(
        hideIfRotatedNorth: true,
      ),

      // Or use the primary constructor to customize all
      const MapCompass(
        icon: Icon(Icons.arrow_upward),
        hideIfRotatedNorth: true,
      ),
    ],
  );
}

Additional information

If you need help you can open an issue or join the flutter_map discord server.