googlemaps / android-maps-compose

Jetpack Compose composables for the Maps SDK for Android
https://developers.google.com/maps/documentation/android-sdk/maps-compose
Apache License 2.0
1.16k stars 139 forks source link

Heat Map in compose #471

Closed majatestad closed 4 months ago

majatestad commented 10 months ago

I'm searching for functionality to implement heat map over my map in jetpack compose. I have not found any documentation on this, and as I understood from my Discourse request, there may not be any solution for this yet.

wangela commented 10 months ago

If you would like to upvote the priority of this issue, please comment below or react on the original post above with :+1: so we can see what is popular when we triage.

@meyja Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

Slion commented 4 months ago

Heatmaps are working just fine as it is. You need to use TileOverlay together with HeatmapTileProvider. See: https://developers.google.com/maps/documentation/android-sdk/utility/heatmap

dkhawk commented 4 months ago

IIUC, you will have to use a MapEffect to add a heat map to a composable map.

If you follow this [example] (https://developers.google.com/maps/documentation/android-sdk/utility/heatmap#simple), you would just need to change this call val overlay = map.addTileOverlay(TileOverlayOptions().tileProvider(provider)) to happen in a MapEffect.

This particular part should be similar to how other layers are added to the composable map. See this example https://developers.google.com/codelabs/maps-platform/maps-platform-101-compose#outline-the-mountain-ranges