Hi, I am looking into ways to show a map in my com...
# compose
k
Hi, I am looking into ways to show a map in my compose application. I have found the Google maps compose library (https://developers.google.com/maps/documentation/android-sdk/maps-compose). However my application would benefit from more nature oriented map (showing trails in forest, marked paths etc.). I know an API which will respond with map tile images I can use . Do you know if there is some kotlin/compose library which would allow me to render map from custom API and also draw points, route on top (ideally I would want to use mapy.cz API for getting the map tiles)? Thanks!
m
You may want to check out google maps utils with the overlay and KML stuff -- you can draw things on top of the map separately and there are some reasonable blogs about making animated drawn lines and things on top
r
You can use openstreet map with custom compose-native utilities for loading tiles and drawing them on the canvas. This is a working example (I don't know if it originates in this repo or somewhere else): https://github.com/ShreyashKore/wonderous_compose/tree/main/mapview-desktop/src/desktopMain/kotlin/example/map So I am sure it can be adapted with a different tile loader. Here is a PR in the same repo to make it generic and work across all platforms: https://github.com/ShreyashKore/wonderous_compose/pull/19/files
🙌 1
k
Awesome, thanks. I'll look into it. :)
👍 1