0

I have a Google Map in my Android Kotlin App. I want to do something as follows :

  • The User should be able to cut out a rectangular portion from the map
  • This rectangular portion should be send as an image to an API (Here the API accepts requests in the form of image in multipart data)
  • The location of the cut-out area should also be send as a response to the API.

Any suggestions on how to do this? Thanks in advance!

  • Try image cropper utill class... – Gobu CSG Jul 10 '22 at 07:23
  • check [this](https://stackoverflow.com/questions/2661536/how-to-programmatically-take-a-screenshot-on-android) answer for take screenshots programatically, and use [this](https://github.com/ArthurHub/Android-Image-Cropper) library to crop it. – alpertign Jul 10 '22 at 08:51
  • Ok...Thanks a lot. I will try it once. – sceptre_rose Jul 10 '22 at 12:08
  • @AlperenAcikgoz I tried taking the screenshot using Bitmap and Canvas. It is working for all other views except the map. For Maps I am getting a blank screenshot with only the word "Google" written at the bottom corner. Any suggestions on how to solve the issue? – sceptre_rose Jul 11 '22 at 16:24
  • @sceptre_rose try implement snapshotReadyCallback it invokes when shapshot has been taken. [Here](https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMap.SnapshotReadyCallback) is the reference – alpertign Jul 13 '22 at 06:23

0 Answers0