in compose map, how do i get a screenshot of the m...
# compose
m
in compose map, how do i get a screenshot of the map, as in:
snapshot(@NonNull GoogleMap.SnapshotReadyCallback callback) ?
o
What do you mean by “compose map”? You want to take a screenshot from the Google Map?
m
Legacy GoogleMap has a method
snapshot
which generates a bitmap of the map content. Compose version has no such method, nor indirect access to GoogleMap instance.
o
Aha, then I am not aware of the compose version of ot 😅 In our recent project we do use normal GoogleMap and use snapshot method to take a screenshot Moreover our use case was just to use a map to take a screenshot and then show a bitmap instead of a map
Is it something you want to achieve? Or is your use-case different?
m
i just ported the map code to compose and it worked flawlessly for everything. But i forgot that we had a feature that required a snapshot of the map. I didn’t realise until the end. It looks like compose map library doesn’t have that feature yet. I solved the problem by accessing the legacy GoogleMap with reflection and invoking
snapshot
method.
o
Ah, I get it, I did not work with the compose version of the map, sry :/