Move pin to center when clicked.
This commit is contained in:
parent
5c359d4d45
commit
10322545aa
|
@ -45,6 +45,7 @@ import im.vector.app.core.platform.VectorBaseFragment
|
||||||
import im.vector.app.core.utils.DimensionConverter
|
import im.vector.app.core.utils.DimensionConverter
|
||||||
import im.vector.app.core.utils.openLocation
|
import im.vector.app.core.utils.openLocation
|
||||||
import im.vector.app.databinding.FragmentLocationLiveMapViewBinding
|
import im.vector.app.databinding.FragmentLocationLiveMapViewBinding
|
||||||
|
import im.vector.app.features.location.LocationData
|
||||||
import im.vector.app.features.location.UrlMapProvider
|
import im.vector.app.features.location.UrlMapProvider
|
||||||
import im.vector.app.features.location.zoomToBounds
|
import im.vector.app.features.location.zoomToBounds
|
||||||
import im.vector.app.features.location.zoomToLocation
|
import im.vector.app.features.location.zoomToLocation
|
||||||
|
@ -137,11 +138,9 @@ class LocationLiveMapViewFragment @Inject constructor() : VectorBaseFragment<Fra
|
||||||
|
|
||||||
private fun onSymbolClicked(symbol: Symbol?) {
|
private fun onSymbolClicked(symbol: Symbol?) {
|
||||||
symbol?.let {
|
symbol?.let {
|
||||||
val screenLocation = mapboxMap?.get()?.projection?.toScreenLocation(it.latLng)
|
mapboxMap
|
||||||
views.liveLocationPopupAnchor.apply {
|
?.get()
|
||||||
x = screenLocation?.x ?: 0f
|
?.zoomToLocation(LocationData(it.latLng.latitude, it.latLng.longitude, null), preserveCurrentZoomLevel = false)
|
||||||
y = (screenLocation?.y ?: 0f) - views.liveLocationPopupAnchor.height
|
|
||||||
}
|
|
||||||
|
|
||||||
LocationLiveMapMarkerOptionsDialog(requireContext())
|
LocationLiveMapMarkerOptionsDialog(requireContext())
|
||||||
.apply {
|
.apply {
|
||||||
|
|
|
@ -8,8 +8,9 @@
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/liveLocationPopupAnchor"
|
android:id="@+id/liveLocationPopupAnchor"
|
||||||
android:layout_width="40dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="40dp" />
|
android:layout_height="0dp"
|
||||||
|
android:layout_gravity="center"/>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/liveLocationMapFragmentContainer"
|
android:id="@+id/liveLocationMapFragmentContainer"
|
||||||
|
|
Loading…
Reference in New Issue