feat: replace layer toggle with layer selector menu

- Replace ToggleMapLayerAction with SelectMapLayerAction that takes a specific layer
- Update fireMapReducer to handle SelectMapLayerAction instead of toggling
- Use PopupMenuButton with GlobalKey to open menu on button tap
- Show check icon and bold text for currently selected layer
- Menu items display layer names: OSMC Grey, OSMC, Esri Street, Esri Satellite, Esri Terrain
- Selecting a layer immediately updates Redux state and closes the menu
This commit is contained in:
vjrj 2026-03-06 08:33:52 +01:00
parent 498f2ca7d6
commit 14b558340d
3 changed files with 66 additions and 18 deletions

View file

@ -1,5 +1,6 @@
import 'package:fires_flutter/models/yourLocation.dart';
import 'package:fires_flutter/models/fireNotification.dart';
import 'package:fires_flutter/models/fireMapState.dart';
abstract class FiresMapActions {}
@ -42,7 +43,7 @@ class EditYourLocationAction extends FiresMapActions {
EditYourLocationAction(this.loc);
}
class EditConfirmYourLocationAction extends FiresMapActions{
class EditConfirmYourLocationAction extends FiresMapActions {
YourLocation loc;
EditConfirmYourLocationAction(this.loc);
@ -53,4 +54,8 @@ class EditCancelYourLocationAction extends FiresMapActions {
EditCancelYourLocationAction(this.loc);
}
class ToggleMapLayerAction extends FiresMapActions {}
class SelectMapLayerAction extends FiresMapActions {
final FireMapLayer layer;
SelectMapLayerAction(this.layer);
}