Commit fbb79620 authored by wanglei's avatar wanglei

...

parent 641b378a
......@@ -82,7 +82,7 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
if (currentViewingBean != viewingBean) {
removeOldViewingMarker()
currentViewingBean = viewingBean
setViewingBeanMarker()
setViewingBeanMarker(15f)
}
startGetLocationJob()
......@@ -266,7 +266,7 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
}
}
private fun setViewingBeanMarker() {
private fun setViewingBeanMarker(zoom: Float? = null) {
currentViewingBean?.let { viewingBean ->
viewingBean.locatDate?.let { locatDate ->
......@@ -278,7 +278,7 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
friendMarker = map?.addLocationMarker(friendAvatar, latLng, viewingBean.nickname)
}
setViewBeanLocation(latLng)
setViewBeanLocation(latLng, zoom)
}
}
}
......@@ -288,8 +288,10 @@ class LocationMapActivity : BaseActivity<ActivityLocationMapBinding>(), OnMapRea
friendMarker = null
}
private fun setViewBeanLocation(latLng: LatLng) {
map?.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 15f))
private fun setViewBeanLocation(latLng: LatLng, zoom: Float? = null) {
zoom?.let {
map?.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, it))
}
myMarker?.position = latLng
}
......
......@@ -16,6 +16,8 @@
class="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="FragmentTagUsage" />
<ImageView
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment