MESSENGER-4235 - location sharing without gps

This commit is contained in:
JanNiklas Grabowski
2023-02-09 17:50:33 +01:00
parent e3011a670c
commit eae05b3093
2 changed files with 34 additions and 4 deletions
@@ -151,6 +151,8 @@ extension LocationSharingMapView {
fallthrough
case .denied:
locationSharingMapView.errorSubject.send(.invalidLocationAuthorization)
// bwi: center map if gps is not available
centerMapOnDefaultPosition(mapView: mapView)
default:
break
}
@@ -190,6 +192,11 @@ extension LocationSharingMapView {
func didPan() {
locationSharingMapView.userDidPan?()
}
// bwi: center map on default position (Germany)
func centerMapOnDefaultPosition(mapView: MGLMapView) {
mapView.setVisibleCoordinateBounds(MGLCoordinateBounds(sw: CLLocationCoordinate2D(latitude: CLLocationDegrees(47.11216018072962), longitude: CLLocationDegrees(6.124326657878219)), ne: CLLocationCoordinate2D(latitude: 54.928634747516774, longitude: 14.641747314488596)), animated: true)
}
}
}