Google Map: only zoom on station once at the beginning

android11
Georg Lukas 2020-10-01 18:37:07 +02:00
rodzic f3c6e600a7
commit 57153b7ea5
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -120,11 +120,12 @@ class GoogleMapAct extends Activity with MapLoaderBase
markers.get(targetcall) match {
case None =>
case Some(sta) =>
map.animateCamera(CameraUpdateFactory.newLatLngZoom(sta.icon.getPosition(), 14f))
if (first_load) {
map.animateCamera(CameraUpdateFactory.newLatLngZoom(sta.icon.getPosition(), 14f))
sta.icon.showInfoWindow()
first_load = false
}
} else
map.animateCamera(CameraUpdateFactory.newLatLng(sta.icon.getPosition()))
}
}
}