Implement legacy-style map markers with UI model mapping.

Replace default OSM pins with round value-based icons, add DTO-to-domain-to-UI marker mapping, and normalize no-value/offline styling while keeping ownership icon behavior stubbed for future auth integration.

Made-with: Cursor
This commit is contained in:
2026-03-01 00:19:40 +01:00
parent 02c33e5ad5
commit 920a832424
14 changed files with 362 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
query MapMarkers($isOnline: Boolean!) {
locations(filter: { isOnline: $isOnline }) {
query MapMarkers {
locations {
_id
name
city
@@ -9,6 +9,7 @@ query MapMarkers($isOnline: Boolean!) {
metricList
currentValue {
PMS25
Count
}
}
}

View File

@@ -13,7 +13,9 @@ class ApolloMapItemMapper @Inject constructor() {
city = location.city?.ifBlank { null },
latitude = location.latitude,
longitude = location.longitude,
isOnline = location.isOnline ?: false
isOnline = location.isOnline ?: false,
dustValue = location.currentValue?.PMS25?.toDouble(),
radioactivityValue = location.currentValue?.Count?.toDouble()
)
}
}

View File

@@ -13,7 +13,7 @@ class MapServiceImpl @Inject constructor(
override suspend fun fetchMapItems(): List<MapItem> {
Log.d(TAG, "Executing MapMarkers Apollo query")
val response = apolloClient
.query(MapMarkersQuery(isOnline = false))
.query(MapMarkersQuery())
.execute()
response.errors?.firstOrNull()?.let { gqlError ->

View File

@@ -6,5 +6,7 @@ data class MapItem(
val city: String?,
val latitude: Double,
val longitude: Double,
val isOnline: Boolean
val isOnline: Boolean,
val dustValue: Double?,
val radioactivityValue: Double?
)