MyMap is a lightweight Android app built with Jetpack Compose and Google Maps. It displays route polylines based on encoded geometry from Map.ir API. Fully written in Kotlin with a clean architecture approach and beautiful map rendering using the latest Google Maps Compose library.
- Decode and draw route polylines using encoded geometry
- Google Maps integration via
maps-compose - State-driven UI with ViewModel +
mutableStateOf - Prevents multiple API calls on recomposition
- Supports multi-leg route rendering
- Clean, simple structure and reusable components
- Jetpack Compose
- Google Maps Compose
- Maps Utils KTX
- Kotlin + MVVM
- DI Hilt
📸 Preview
🧪 Example
@Stable
interface RoutUiState {
val routeDto: RouteDto?
}
private class MutableRoutUiState : RoutUiState {
override var routeDto: RouteDto? by mutableStateOf(null)
}
uiState.routeDto?.let {
val polylinePoints = decodeRouteToLatLng(it)
Polyline(
points = polylinePoints,
color = Color.Blue,
width = 16f,
)
}
🛣️ TODO
- Add user location tracking
- Animate camera along the route
- Offline map caching
🙌 Contributing Feel free to fork, improve, or file issues. Stars are welcome 🌟