|
1 |
| -# Plugins for the flutter_map ecosystem 🗺️ |
| 1 | +# flutter_map_compass |
2 | 2 |
|
3 |
| -This repository contains multiple flutter packages that extend the |
4 |
| -functionality of [flutter_map](https://pub.dev/packages/flutter_map). |
5 |
| - |
6 |
| -[](https://github.com/josxha/flutter_map_plugins/stargazers) |
7 |
| -[](https://codecov.io/gh/josxha/flutter_map_plugins) |
8 |
| -[](https://github.com/josxha/flutter_map_plugins) |
9 |
| -[](https://github.com/josxha/flutter_map_plugins/issues) |
10 |
| -[](https://GitHub.com/josxha/flutter_map_plugins/pulls) |
11 |
| - |
12 |
| -- A combined example app can be found under |
13 |
| - [./example](https://github.com/josxha/flutter_map_plugins) |
14 |
| - or use the hosted version |
15 |
| - at [https://flutter-map-plugins.web.app](https://flutter-map-plugins.web.app/). |
16 |
| -- Need a list of all `flutter_map` plugins? Check out |
17 |
| - the [awesome-flutter-map](https://github.com/josxha/awesome-flutter-map?tab=readme-ov-file#awesome-flutter-map) |
18 |
| - list. |
19 |
| - |
20 |
| -## Packages |
21 |
| - |
22 |
| -### [flutter_map_cache](https://pub.dev/packages/flutter_map_cache) |
23 |
| - |
24 |
| -[](https://pub.dev/packages/flutter_map_cache) |
25 |
| -[](https://pub.dev/packages/flutter_map_cache) |
26 |
| -[](https://pub.dev/packages/flutter_map_cache) |
27 |
| - |
28 |
| -A slim yet powerful caching plugin for flutter_map tile layers. Supports any |
29 |
| -storage backend you would possibly want. |
30 |
| - |
31 |
| -- This package fills the gap |
32 |
| - between [dio_cache_interceptor](https://pub.dev/packages/dio_cache_interceptor) |
33 |
| - and flutter_map. |
34 |
| -- Support for tile cancellation |
35 |
| - |
36 |
| -### [flutter_map_compass](https://pub.dev/packages/flutter_map_compass) |
| 3 | +A simple compass for flutter_map. It shows the rotation of the map and resets |
| 4 | +the rotation back to 0 when tapped. |
37 | 5 |
|
38 | 6 | [](https://pub.dev/packages/flutter_map_compass)
|
39 | 7 | [](https://pub.dev/packages/flutter_map_compass)
|
| 8 | +[](https://pub.dev/packages/flutter_map_compass/score) |
40 | 9 | [](https://pub.dev/packages/flutter_map_compass)
|
41 | 10 |
|
42 |
| -A compass for flutter_map that indicates the map rotation. It rotates the map |
43 |
| -back to north on top when clicked. |
44 |
| - |
45 |
| -### [flutter_map_mbtiles](https://pub.dev/packages/flutter_map_mbtiles) |
46 |
| - |
47 |
| -[](https://pub.dev/packages/flutter_map_mbtiles) |
48 |
| -[](https://pub.dev/packages/flutter_map_mbtiles) |
49 |
| -[](https://pub.dev/packages/flutter_map_mbtiles) |
50 |
| - |
51 |
| -This package provides the `MbTilesTileProvider` that can be used with |
52 |
| -flutter_map tile layers. |
53 |
| - |
54 |
| -- This package uses [mbtiles](https://pub.dev/packages/mbtiles) under the hood |
55 |
| - for the MBTiles support. |
56 |
| -- MBTiles is a file format to store map tiles in a single SQLite database. |
57 |
| - |
58 |
| -### [flutter_map_pmtiles](https://pub.dev/packages/flutter_map_pmtiles) |
59 |
| - |
60 |
| -[](https://pub.dev/packages/flutter_map_pmtiles) |
61 |
| -[](https://pub.dev/packages/flutter_map_pmtiles) |
62 |
| -[](https://pub.dev/packages/flutter_map_pmtiles) |
63 |
| - |
64 |
| -This package provides the `PmTilesTileProvider` that can be used with |
65 |
| -flutter_map tile layers. |
66 |
| - |
67 |
| -- This package uses [pmtiles](https://pub.dev/packages/pmtiles) under the hood |
68 |
| - for the PMTiles support. |
69 |
| -- PMTiles is an open archive format for pyramids of tile data, accessible via |
70 |
| - HTTP Range Requests. Head over to [protomaps.com](https://protomaps.com/) to |
71 |
| - learn more about |
72 |
| - PMTiles. |
73 |
| - |
74 |
| -### [vector_map_tiles_mbtiles](https://pub.dev/packages/vector_map_tiles_mbtiles) |
75 |
| - |
76 |
| -[](https://pub.dev/packages/vector_map_tiles_mbtiles) |
77 |
| -[](https://pub.dev/packages/vector_map_tiles_mbtiles) |
78 |
| -[](https://pub.dev/packages/vector_map_tiles_mbtiles) |
79 |
| - |
80 |
| -This package provides the `MbTilesVectorTileProvider` that can be used with |
81 |
| -the [vector_map_tiles](https://pub.dev/packages/vector_map_tiles) which itself |
82 |
| -adds support for vector tiles to flutter_map. |
83 |
| - |
84 |
| -- This package uses [mbtiles](https://pub.dev/packages/mbtiles) under the hood |
85 |
| - for the MBTiles support. |
86 |
| -- MBTiles is a file format to store map tiles in a single SQLite database. |
87 |
| - |
88 |
| -### [vector_map_tiles_pmtiles](https://pub.dev/packages/vector_map_tiles_pmtiles) |
89 |
| - |
90 |
| -[](https://pub.dev/packages/vector_map_tiles_pmtiles) |
91 |
| -[](https://pub.dev/packages/vector_map_tiles_pmtiles) |
92 |
| -[](https://pub.dev/packages/vector_map_tiles_pmtiles) |
93 |
| - |
94 |
| -This package provides the `PmTilesVectorTileProvider` that can be used with |
95 |
| -the [vector_map_tiles](https://pub.dev/packages/vector_map_tiles) which itself |
96 |
| -adds support for vector tiles to flutter_map. |
97 |
| - |
98 |
| -- This package uses [pmtiles](https://pub.dev/packages/pmtiles) under the hood |
99 |
| - for the PMTiles support. |
100 |
| -- PMTiles is an open archive format for pyramids of tile data, accessible via |
101 |
| - HTTP Range Requests. Head over to [protomaps.com](https://protomaps.com/) to |
102 |
| - learn more about |
103 |
| - PMTiles. |
104 |
| - |
105 |
| -## Contributions |
106 |
| - |
107 |
| -A huge thanks to all contributors! 😎 |
| 11 | +[](https://github.com/josxha/flutter_map_plugins) |
| 12 | +[](https://github.com/josxha/flutter_map_plugins/stargazers) |
| 13 | +[](https://github.com/josxha/flutter_map_plugins/issues) |
| 14 | +[](https://codecov.io/gh/josxha/flutter_map_plugins) |
108 | 15 |
|
109 |
| -[](https://github.com/josxha/flutter_map_plugins/graphs/contributors) |
| 16 | +<img src="https://raw.githubusercontent.com/josxha/flutter_map_plugins/main/flutter_map_compass/images/screenshot.jpg" width="350px" alt="Example screenshot"> |
| 17 | + |
| 18 | +## Getting started |
| 19 | + |
| 20 | +Add the following packages to your `pubspec.yaml` file: |
| 21 | + |
| 22 | +```yaml |
| 23 | +dependencies: |
| 24 | + flutter_map: ^6.0.0 # in case you don't have it yet |
| 25 | + flutter_map_compass: ^1.0.0 # this package |
| 26 | +``` |
| 27 | +
|
| 28 | +## Usage |
| 29 | +
|
| 30 | +```dart |
| 31 | +@override |
| 32 | +Widget build(BuildContext context) { |
| 33 | + return FlutterMap( |
| 34 | + options: MapOptions(), |
| 35 | + children: [ |
| 36 | + TileLayer( |
| 37 | + urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', |
| 38 | + ), |
| 39 | + |
| 40 | + // use the default compass that is based on the cupertino compass icon |
| 41 | + const MapCompass.cupertino( |
| 42 | + hideIfRotatedNorth: true, |
| 43 | + ), |
| 44 | + |
| 45 | + // Or use the primary constructor to customize all |
| 46 | + const MapCompass( |
| 47 | + icon: Icon(Icons.arrow_upward), |
| 48 | + hideIfRotatedNorth: true, |
| 49 | + ), |
| 50 | + ], |
| 51 | + ); |
| 52 | +} |
| 53 | +``` |
| 54 | + |
| 55 | +## Additional information |
| 56 | + |
| 57 | +If you need help you |
| 58 | +can [open an issue](https://github.com/josxha/flutter_map_plugins/issues/new/choose) |
| 59 | +or join |
| 60 | +the [`flutter_map` discord server](https://discord.gg/BwpEsjqMAH). |
0 commit comments