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:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 ->
|
||||
|
||||
@@ -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?
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user