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:
parent
980517c168
commit
fbb66864e5
1 changed files with 1 additions and 6 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue