Show favorites on map

This commit is contained in:
Reimar 2024-08-22 11:46:45 +02:00
parent cae02bfded
commit 67f3cd118f
Signed by: Reimar
GPG Key ID: 93549FA07F0AE268

View File

@ -76,23 +76,24 @@ class _MyHomePageState extends State<MyHomePage> {
key: _scaffoldKey, key: _scaffoldKey,
//drawer: navigationMenu, //drawer: navigationMenu,
body: FlutterMap( body: FlutterMap(
options: const MapOptions( options: const MapOptions(initialCenter: LatLng(55.9397, 9.5156), initialZoom: 7.0),
initialCenter: LatLng(55.9397, 9.5156), initialZoom: 7.0),
children: [ children: [
openStreetMapTileLayer, openStreetMapTileLayer,
const MarkerLayer(markers: [ ..._favorites.map((favorite) =>
MarkerLayer(markers: [
Marker( Marker(
point: LatLng(56.465511, 9.411366), point: LatLng(favorite.lat, favorite.lng),
width: 60, width: 60,
height: 100, height: 100,
alignment: Alignment.center, alignment: Alignment.center,
child: Icon( child: const Icon(
Icons.location_pin, Icons.location_pin,
size: 60, size: 60,
color: Colors.purple, color: Colors.yellow,
)
)
])
), ),
),
]),
], ],
), ),
), ),