Skip to content

Instantly share code, notes, and snippets.

@dmz9
Last active May 25, 2018 10:01
Show Gist options
  • Save dmz9/67e1149a25bc51ac754f8359aaeb2876 to your computer and use it in GitHub Desktop.
Save dmz9/67e1149a25bc51ac754f8359aaeb2876 to your computer and use it in GitHub Desktop.
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