mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Move the shared map types into a new MapLibreInterface framework
Groundwork for loading MapLibre on demand. The map view is about to move into its own framework, and both sides need to agree on the types that cross the boundary, so ShowUserLocationMode and MapLibreError move out of the app into a small framework that the app links.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
import Combine
|
||||
import MapLibre
|
||||
import MapLibreInterface
|
||||
import SwiftUI
|
||||
|
||||
struct MapLibreMapView: UIViewRepresentable {
|
||||
|
||||
@@ -8,32 +8,6 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
/**
|
||||
Behavior mode of the current user's location, can be hidden, only shown and shown following the user
|
||||
*/
|
||||
enum ShowUserLocationMode: Equatable {
|
||||
/// this mode will show the user pin in map
|
||||
case show
|
||||
/// this mode will show the user pin in map and track him, panning the map automatically
|
||||
case showAndFollow
|
||||
/// this mode will not show the user pin in map
|
||||
case hide
|
||||
/// this mode will not show the user pin in map and will follow the marker with the given id,
|
||||
/// panning the map automatically.
|
||||
case hideAndFollowMarker(id: String)
|
||||
|
||||
/// The id of the marker the map should follow when in the `hideAndFollowMarker` mode, nil otherwise.
|
||||
var followedMarkerID: String? {
|
||||
guard case .hideAndFollowMarker(let id) = self else { return nil }
|
||||
return id
|
||||
}
|
||||
}
|
||||
|
||||
enum MapLibreError: Error {
|
||||
case failedLoadingMap
|
||||
case failedLocatingUser
|
||||
}
|
||||
|
||||
/// The style to show a map in.
|
||||
///
|
||||
/// There can be any number of styles, we have defined one for light and another for dark.
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import CoreLocation
|
||||
import Foundation
|
||||
import MapLibreInterface
|
||||
import MatrixRustSDK
|
||||
|
||||
enum LocationSharingViewAlert: Hashable {
|
||||
|
||||
Reference in New Issue
Block a user