Skip to content
pubscout

flutter_map_compass

1.1.2, released 3 weeks ago by joscha-eckert.de

A simple compass widget for flutter_map displaying rotation and resetting it when tapped.

WASM-ready
$ flutter pub add flutter_map_compass
Source repository

What it does

It shows the current rotation of a flutter_map instance using a compass indicator. When the compass is tapped, it resets the map rotation back to 0. It also offers options to customize the icon or hide itself when the map is already rotated north.

AI-written summary of version 1.1.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are using flutter_map and need a compass indicator widget
  • You want a quick way for users to reset map rotation back to north with a tap

Skip it when

  • You are using Google Maps instead of flutter_map
  • You do not need map rotation or compass features in your application

Strengths

  • Easy to drop into existing flutter_map projects
  • Supports custom icons or a built-in cupertino style
  • Includes a feature to automatically hide when rotated north

Weaknesses

  • Strictly limited to flutter_map

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Just add the dependency to pubspec.yaml and include the widget as a child in your FlutterMap.

FlutterMap(
  options: MapOptions(),
  children: [
    TileLayer(
      urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
    ),
    const MapCompass.cupertino(
      hideIfRotatedNorth: true,
    ),
  ],
)

Alternatives

Packages that do the same job and could replace flutter_map_compass.

Works with

Packages commonly used together with flutter_map_compass: ones it builds on, ones built on it, and its own family.