Skip to content

Instantly share code, notes, and snippets.

@mizutori
Created January 6, 2019 09:26
Show Gist options
  • Save mizutori/2a6c8c3ec1bc93b1acc8b487710ba756 to your computer and use it in GitHub Desktop.
Save mizutori/2a6c8c3ec1bc93b1acc8b487710ba756 to your computer and use it in GitHub Desktop.
private fun zoomMapTo(location: Location) {
val latLng = LatLng(location.latitude, location.longitude)
try {
map.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 17.5f))
this.didInitialZoom = true
return
} catch (e: Exception) {
e.printStackTrace()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment