Change the method to zoom the map camera when a suggestion is selected from the Toolbar's SearchView in MerchantsFragment, it now shows a much bigger area.

This commit is contained in:
Severiano Jaramillo 2019-01-31 15:22:40 -06:00
parent 980517c168
commit fbb66864e5

View file

@ -299,13 +299,8 @@ class MerchantsFragment : Fragment(), OnMapReadyCallback, SearchView.OnSuggestio
cursor?.close() cursor?.close()
if (lat != null && lon != null) { if (lat != null && lon != null) {
val builder = LatLngBounds.builder()
builder.include(LatLng(lat, lon))
val bounds = builder.build()
try { try {
mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100)) mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(LatLng(lat, lon), 15f))
} catch (e: Exception) { } catch (e: Exception) {
Log.d(TAG, e.message) Log.d(TAG, e.message)
} }