Skip to content Skip to sidebar Skip to footer

Very Poor Quality And Too Small Snapshot Of Map Activity

I want to take a snapshot of the map when user select place from place picker activity. I'm storing this image to the SD card. But it gives very poor quality. I can't understand wh

Solution 1:

Not sure of this, but it might be that the CameraUpdate is not done when you take the snapshot.

You could try this:

booleanplacePicked=false;

protectedvoidonActivityResult(int requestCode, int resultCode, Intent data) {

    if (requestCode == PLACE_PICKER_REQUEST && resultCode == Activity.RESULT_OK) {
        placePicked = true;
        // Do everything else, except taking the snapshot.
    } else {
        super.onActivityResult(requestCode, resultCode, data);
    }
}

@OverridepublicvoidonCameraIdle() {
    if (placePicked) {
        placePicked = false;

        // take snapshot...
    }
}

onCameraIdle is the method called when there was a CameraUpdate and it is finished.

Your activity should implement GoogleMap.OnCameraIdleListener, and add to your map mMap.setOnCameraIdleListener(this); inside onMapReady().

Also, I'm assuming your map is already loaded. If not, you should account for that using onMapLoaded().

Post a Comment for "Very Poor Quality And Too Small Snapshot Of Map Activity"