From 67f3cd118f8fc51adc1e1667860f914979c8e65c Mon Sep 17 00:00:00 2001 From: Reimar Date: Thu, 22 Aug 2024 11:46:45 +0200 Subject: [PATCH] Show favorites on map --- Mobile/lib/main.dart | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Mobile/lib/main.dart b/Mobile/lib/main.dart index 1304f96..e256729 100644 --- a/Mobile/lib/main.dart +++ b/Mobile/lib/main.dart @@ -76,23 +76,24 @@ class _MyHomePageState extends State { key: _scaffoldKey, //drawer: navigationMenu, body: FlutterMap( - options: const MapOptions( - initialCenter: LatLng(55.9397, 9.5156), initialZoom: 7.0), + options: const MapOptions(initialCenter: LatLng(55.9397, 9.5156), initialZoom: 7.0), children: [ openStreetMapTileLayer, - const MarkerLayer(markers: [ - Marker( - point: LatLng(56.465511, 9.411366), - width: 60, - height: 100, - alignment: Alignment.center, - child: Icon( - Icons.location_pin, - size: 60, - color: Colors.purple, - ), - ), - ]), + ..._favorites.map((favorite) => + MarkerLayer(markers: [ + Marker( + point: LatLng(favorite.lat, favorite.lng), + width: 60, + height: 100, + alignment: Alignment.center, + child: const Icon( + Icons.location_pin, + size: 60, + color: Colors.yellow, + ) + ) + ]) + ), ], ), ),