Snapshot Ready Callback
Callback interface for receiving map snapshots.
This callback is invoked when a snapshot of the map has been captured. The callback is always invoked on the Android UI thread.
Example usage:
// Lambda syntax (fun interface benefit)
mapView.snapshot { bitmap ->
if (bitmap != null) {
// Save or display the bitmap
imageView.setImageBitmap(bitmap)
} else {
// Snapshot failed (view not laid out)
}
}
// Traditional syntax
mapView.snapshot(object : SnapshotReadyCallback {
override fun onSnapshotReady(bitmap: Bitmap?) {
// Handle bitmap
}
})Content copied to clipboard