added map
This commit is contained in:
		| @@ -1,4 +1,8 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:flutter_map/flutter_map.dart'; | ||||
| import 'package:http/http.dart'; | ||||
| import 'package:http/retry.dart'; | ||||
| import 'package:latlong2/latlong.dart'; | ||||
|  | ||||
| class MapView extends StatefulWidget { | ||||
|   const MapView({super.key}); | ||||
| @@ -10,6 +14,24 @@ class MapView extends StatefulWidget { | ||||
| class _MapViewState extends State<MapView> { | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return const Placeholder(); | ||||
|     return FlutterMap( | ||||
|       options: const MapOptions( | ||||
|         initialCenter: LatLng(50.354, 7.5845), | ||||
|         initialZoom: 16, | ||||
|       ), | ||||
|       children: [ | ||||
|         TileLayer( | ||||
|           urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', | ||||
|         ), | ||||
|         TileLayer( | ||||
|           urlTemplate: "https://bubatzkarte.de/tiles/radius/100/{z}/{x}/{y}.png", | ||||
|           tileProvider: NetworkTileProvider( | ||||
|             httpClient: RetryClient( | ||||
|               Client(), | ||||
|               when: (response) => response.statusCode == 502) | ||||
|           ), | ||||
|         ) | ||||
|       ], | ||||
|     ); | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user