mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Send location uncertainty within a geo uri (#1309)
* Add uncertainty * Add UTs * Delete verticalAccuracy
This commit is contained in:
@@ -109,6 +109,7 @@ struct StaticLocationScreenViewState: BindableState {
|
||||
|
||||
struct StaticLocationScreenBindings {
|
||||
var mapCenterLocation: CLLocationCoordinate2D?
|
||||
var geolocationUncertainty: CLLocationAccuracy?
|
||||
|
||||
var showsUserLocationMode: ShowUserLocationMode
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@ class StaticLocationScreenViewModel: StaticLocationScreenViewModelType, StaticLo
|
||||
actionsSubject.send(.close)
|
||||
case .selectLocation:
|
||||
guard let coordinate = state.bindings.mapCenterLocation else { return }
|
||||
actionsSubject.send(.sendLocation(.init(coordinate: coordinate), isUserLocation: state.isSharingUserLocation))
|
||||
let uncertainty = state.isSharingUserLocation ? context.geolocationUncertainty : nil
|
||||
actionsSubject.send(.sendLocation(.init(coordinate: coordinate, uncertainty: uncertainty), isUserLocation: state.isSharingUserLocation))
|
||||
case .userDidPan:
|
||||
state.bindings.showsUserLocationMode = .show
|
||||
case .centerToUser:
|
||||
|
||||
@@ -47,10 +47,12 @@ struct StaticLocationScreen: View {
|
||||
showsUserLocationMode: $context.showsUserLocationMode,
|
||||
error: $context.mapError,
|
||||
mapCenterCoordinate: $context.mapCenterLocation,
|
||||
isLocationAuthorized: $context.isLocationAuthorized) {
|
||||
isLocationAuthorized: $context.isLocationAuthorized,
|
||||
geolocationUncertainty: $context.geolocationUncertainty) {
|
||||
context.send(viewAction: .userDidPan)
|
||||
}
|
||||
.ignoresSafeArea(.all, edges: mapSafeAreaEdges)
|
||||
|
||||
if context.viewState.isLocationPickerMode {
|
||||
LocationMarkerView()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user