MapViewModel

class MapViewModel(application: Application) : AndroidViewModel

The view model for the map view.

Parameters

application

Constructors

Link copied to clipboard
fun MapViewModel(application: Application)

Functions

Link copied to clipboard
fun clear()
Link copied to clipboard
fun createAQPolygons(resPair: List<Pair<LatLng, Double>>)
Link copied to clipboard
fun currentLocationIsDefault(): Boolean
Link copied to clipboard
fun currentPos(): MutableLiveData<LatLng>
Link copied to clipboard
fun getAirQuality(): List<Pair<LatLng, Double>>
Link copied to clipboard
open fun <T : Application> getApplication(): T
Link copied to clipboard
fun getBubbleSquareSize(context: Context): Int

Responsive size calculation of overlay bubbles

Link copied to clipboard
suspend fun getRoute(    start: LatLng,     end: LatLng,     context: Context): Map<GetRouteAlternativesUseCase.RouteType, FullRoute>
Link copied to clipboard
open fun <T : Any> getTag(p0: String): T
Link copied to clipboard
fun isCurrentPosInNorway(context: Context): Boolean
Link copied to clipboard
open fun onCleared()
Link copied to clipboard
fun parseAndUpdateComponentFromPreferences()
Link copied to clipboard
fun permissionCallback()

Callback from the view that we have gotten the permission to access the user's location.

Link copied to clipboard
open fun <T : Any> setTagIfAbsent(p0: String, p1: T): T
Link copied to clipboard
suspend fun updateAirQuality(component: NILUSource.COMPONENTS)
Link copied to clipboard
fun updateBubbleZoomLevel(oldZoomLevel: Double, newZoomLevel: Double): Boolean
Link copied to clipboard
fun updateLocationListener(registerListener: (input: LocationUpdateListener) -> Unit)

Register new Location Listener, necessary on lifecycle changes.

Link copied to clipboard
suspend fun updateWeatherAndDeviations(context: Context)

Update the current weather data and the overlay bubbles.

Properties

Link copied to clipboard
var aqComponent: NILUSource.COMPONENTS
Link copied to clipboard
val aqPolygons: MutableLiveData<List<Triple<List<LatLng>, Int, Float>>>
Link copied to clipboard
val bikeRoutes: MutableLiveData<List<List<LatLng>>>

Bike routes from api.

Link copied to clipboard
val chosenRoute: MutableLiveData<FullRoute?>

The chosen route from the route selection overlay.

Link copied to clipboard
val chosenSearchResult: MutableLiveData<SearchResult?>

The chosen search result from the search window.

Link copied to clipboard
var newSearchResult: Boolean = false

Trigger for when this is a new unique search result

Link copied to clipboard
var overlayBubbles: MutableLiveData<MutableList<OverlayBubble>>

overlayBubbles to be drawn on the map.

Link copied to clipboard
val polyline: MutableLiveData<List<Pair<List<LatLng>, Int>>>

Lines to be drawn on the map. Pair of lat/long coordinates and a color.

Link copied to clipboard
var registerListener: (input: LocationUpdateListener) -> Unit

The listener that should be used to register for location updates.

Link copied to clipboard
val routesOnDisplay: MutableList<Long>

Ids of the tomtom routes currently displayed on the map.

Link copied to clipboard
var savedCameraPosition: CameraPosition? = null
Link copied to clipboard
val shouldGetPermission: MutableLiveData<Boolean>

Should we request location permission from the user?

Link copied to clipboard
val weather: MutableLiveData<WeatherDataPoint>

The current weather data.