https://github.com/Xennis/flutter_map_location
flutter_map plugin to request and display the users location and heading on the map
https://github.com/Xennis/flutter_map_location
flutter flutter-map location open-street-map
Last synced: 3 months ago
JSON representation
flutter_map plugin to request and display the users location and heading on the map
- Host: GitHub
- URL: https://github.com/Xennis/flutter_map_location
- Owner: Xennis
- License: mit
- Archived: true
- Created: 2020-07-27T16:59:37.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-19T14:18:48.000Z (almost 4 years ago)
- Last Synced: 2025-03-04T05:35:17.487Z (4 months ago)
- Topics: flutter, flutter-map, location, open-street-map
- Language: Dart
- Homepage: https://pub.dev/packages/flutter_map_location
- Size: 225 KB
- Stars: 19
- Watchers: 2
- Forks: 35
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
**The plugin is discontinued.** Feel free to fork it or checkout [similar plugins](https://flutter-map.vercel.app/plugins/list).
# Flutter Map – Location plugin
[](https://github.com/Xennis/flutter_map_location/actions?query=workflow%3A%22Flutter%22+event%3Apush+branch%3Amain) [](https://pub.dev/packages/flutter_map_location)
A [flutter_map](https://pub.dev/packages/flutter_map) plugin to request and display the users location and heading on the map. The core features of the plugin are:
* Customization: The location button and marker can be completly customized.
* Energy efficiency: The location service is turned off if the app runs in the background.
* Usability: Developers are empowered to ensure a good [user experience](#User-experience).## User experience
Status
* [x] The location button can be changed dependening on the location services status. For example also Google Maps shows a different icon if the location service is off.
* [x] The marker icon can be changed depending on the location accuracy.
* [x] It's possible to show the information (e.g. in form of a snackbar) to the user that the user location is outside of the map bounds.
* [x] The location heading is also shown for devices without an gyroscope. We [patched flutter_compass](https://github.com/hemanthrajv/flutter_compass/pull/38) for that.## Installation
Add flutter_map to your pubspec:
```yaml
dependencies:
flutter_map_location: any # or the latest version on Pub
```### Android
Ensure the following permissions are present in `/android/app/src/main/AndroidManifest.xml`:
```xml
```
See [reference example code](https://github.com/Xennis/flutter_map_location/blob/f864b737cfe6371a297cee3be076b6bc117f572c/example/android/app/src/main/AndroidManifest.xml#L4-L5)
### iOS
Ensure the following permission is present in `/ios/Runner/Info.plist`:
```xml
NSLocationWhenInUseUsageDescription
App needs access to location and direction when open.
```See [reference example code](https://github.com/Xennis/flutter_map_location/blob/f864b737cfe6371a297cee3be076b6bc117f572c/example/ios/Runner/Info.plist#L5-L6)
## Usage
Look at the [default example](https://github.com/Xennis/flutter_map_location/blob/main/example/lib/pages/default.dart) and the notes inside the code. That's a working example.
## Demo / example
A working example can be found in the `example/` directory. It contains a page with the default settings:

... and one with customized button and marker:

(Map attribution: © [OpenStreetMap](https://www.openstreetmap.org/copyright) contributors)
## Credits
The plugin is inspired by [user_location_plugin](https://github.com/igaurab/user_location_plugin) by [igaurab](https://github.com/igaurab).