Replicating some behavior in an iOS app to Android and one of the requirements is to be able to generate a map snapshot. Google maps does offers the ability to create a snapshot of a map but unlike the iOS app I don't see a way of creating the map purely in memory and then saving it to a DB. I've created maps before but it was always done with the intent of showing the map and the user interacting with it. In this scenario I don't want any of that. There should be no map to be viewed at this point. At a later time the generated image (bitmap) from the snapshot will be delivered to the user.
I have the onMapReady function all set like so
override fun onMapReady(map: GoogleMap?) {
map?.let {
//add route
it.addPolyline(routeLines)
//add markers
for(marker in markerOptions) {
it.addMarker(marker)
}
val callback = GoogleMap.SnapshotReadyCallback(){
saveSnapshot(it)
}
it.snapshot(callback)
}
}
But before the onMapReady can even be called, the map itself needs to initiated.
var mMap: GoogleMap? = null
How do I create a map in memory only with no visual?
Thanks ^.^