| 1 | import 'package:flutter_map/flutter_map.dart'; |
| 2 | import 'package:flutter_map_cancellable_tile_provider/flutter_map_cancellable_tile_provider.dart'; |
| 3 | import 'package:aero/constants/main.dart'; |
| 4 | |
| 5 | /// Minimum zoom level at which the map starts querying the backend for airports |
| 6 | /// within the visible bounds. Below this, the visible area is too large to query |
| 7 | /// without flooding the DB and the client. |
| 8 | const double kAirportQueryMinZoom = 4.0 |
| 9 | |
| 10 | TileLayer get openStreetMapTileLayer => TileLayer |
| 11 | urlTemplate: |
| 12 | 'https://api.mapbox.com/styles/v1/mapbox/streets-v12/tiles/{z}/{x}/{y}?access_token={accessToken}', |
| 13 | userAgentPackageName: 'com.phantomknight287.aero', |
| 14 | tileProvider: CancellableNetworkTileProvider(), |
| 15 | additionalOptions: const { |
| 16 | 'accessToken': MAPBOX_API_KEY, |
| 17 | }, |
| 18 | tileDimension: 512, |
| 19 | zoomOffset: -1, |
| 20 | ); |