mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
vector-im/element-ios/issues/5298 - Displaying a modal when tapping on a location in the timeline.
This commit is contained in:
committed by
Stefan Ceriu
parent
17f9639173
commit
2ef67f3ed2
@@ -26,6 +26,8 @@ struct LocationSharingMapView: UIViewRepresentable {
|
||||
|
||||
let tileServerMapURL: URL
|
||||
let avatarData: AvatarInputProtocol
|
||||
let location: CLLocationCoordinate2D?
|
||||
|
||||
let errorSubject: PassthroughSubject<LocationSharingViewError, Never>
|
||||
@Binding var userLocation: CLLocationCoordinate2D?
|
||||
|
||||
@@ -35,8 +37,17 @@ struct LocationSharingMapView: UIViewRepresentable {
|
||||
|
||||
mapView.logoView.isHidden = true
|
||||
mapView.attributionButton.isHidden = true
|
||||
mapView.showsUserLocation = true
|
||||
mapView.userTrackingMode = .follow
|
||||
|
||||
if let location = location {
|
||||
mapView.setCenter(location, zoomLevel: Constants.mapZoomLevel, animated: false)
|
||||
|
||||
let pointAnnotation = MGLPointAnnotation()
|
||||
pointAnnotation.coordinate = location
|
||||
mapView.addAnnotation(pointAnnotation)
|
||||
} else {
|
||||
mapView.showsUserLocation = true
|
||||
mapView.userTrackingMode = .follow
|
||||
}
|
||||
|
||||
return mapView
|
||||
}
|
||||
@@ -70,10 +81,6 @@ class LocationSharingMapViewCoordinator: NSObject, MGLMapViewDelegate {
|
||||
// MARK: - MGLMapViewDelegate
|
||||
|
||||
func mapView(_ mapView: MGLMapView, viewFor annotation: MGLAnnotation) -> MGLAnnotationView? {
|
||||
guard let _ = annotation as? MGLUserLocation else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return UserLocationAnnotatonView(avatarData: avatarData)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user