services/map_settings_service library

Service for managing map display settings with persistence.

Copyright (C) 2025, Software Innovation Institute, ANU.

Licensed under the GNU General Public License, Version 3 (the "License").

License: https://opensource.org/license/gpl-3-0.

Authors: Graham Williams, Miduo

Classes

MapSettings
Data class holding all map display settings.
MapSettingsService
Service for loading and saving map display settings.
ViewportPosition
Represents a map viewport position (center + zoom).

Enums

MapSource
Available map tile sources.

Extensions

MapSourceExtension on MapSource
Extension for MapSource to get tile URLs and metadata.

Constants

defaultEncryptedColor → const Color
defaultInitialLat → const double
Default viewport settings (Darwin centered).
defaultInitialLng → const double
defaultInitialZoom → const double
defaultLocalColor → const Color
defaultUserColor → const Color
Default colors for map markers.

Functions

preloadMapSettings() Future<void>
Preloads map settings in the background to warm up cache. Call this on app startup to make settings instantly available. Uses smart loading: if no local cache, loads from POD first.
syncSettingsFromPod() Future<void>
Syncs settings from POD in background. Call this after preloadMapSettings() to keep settings in sync. Only needed when local cache exists (preloadMapSettings handles first login).