Last active
May 25, 2018 10:01
-
-
Save dmz9/67e1149a25bc51ac754f8359aaeb2876 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun panToBounds() { | |
val isSingleMarker = markerToShopStorage.count() == 1 | |
try { | |
val move: CameraUpdate = when { | |
isSingleMarker -> CameraUpdateFactory.newLatLngZoom(boundsBuilder.build().center, 12f) | |
else -> { | |
val padding = 200 | |
CameraUpdateFactory.newLatLngBounds(boundsBuilder.build(), padding) | |
} | |
} | |
googleMap?.animateCamera(move) | |
} catch (e: Throwable) { | |
Timber.d(e) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment