mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Set map tiler URL from well known if available (#5633)
This commit is contained in:
@@ -390,7 +390,7 @@ extension LocationSharingScreenViewModel {
|
||||
roomProxy.makeLiveLocationServiceReturnValue = liveLocationServiceMock
|
||||
|
||||
return LocationSharingScreenViewModel(interactionMode: interactionMode,
|
||||
mapURLBuilder: AppSettings.volatile().mapTilerConfiguration,
|
||||
mapURLBuilder: AppSettings.volatile().mapTilerSettings.publisher.value,
|
||||
roomProxy: roomProxy,
|
||||
timelineController: MockTimelineController(),
|
||||
liveLocationManager: LiveLocationManagerMock(),
|
||||
|
||||
@@ -68,7 +68,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
||||
audioPlayerState: .init(id: .recorderPreview, title: L10n.commonVoiceMessage, duration: 0),
|
||||
audioRecorderState: .init(),
|
||||
isRoomEncrypted: roomProxy.infoPublisher.value.isEncrypted,
|
||||
isLocationSharingEnabled: appSettings.mapTilerConfiguration.isEnabled,
|
||||
isLocationSharingEnabled: appSettings.mapTilerSettings.publisher.value.isEnabled,
|
||||
bindings: .init()),
|
||||
mediaProvider: mediaProvider)
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ struct TimelineViewState: BindableState {
|
||||
|
||||
var linkMetadataProvider: LinkMetadataProviderProtocol?
|
||||
|
||||
var mapTilerConfiguration: MapTilerConfiguration
|
||||
var mapTilerSettings: MapTilerSettings
|
||||
|
||||
var stoppedLiveLocationIDs: Set<TimelineItemIdentifier> = []
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
|
||||
pinnedEventIDs: roomProxy.infoPublisher.value.pinnedEventIDs,
|
||||
emojiProvider: emojiProvider,
|
||||
linkMetadataProvider: hideTimelineMedia ? nil : linkMetadataProvider,
|
||||
mapTilerConfiguration: appSettings.mapTilerConfiguration,
|
||||
mapTilerSettings: appSettings.mapTilerSettings.publisher.value,
|
||||
bindings: .init(reactionsCollapsed: [:])),
|
||||
mediaProvider: userSession.mediaProvider)
|
||||
|
||||
|
||||
+2
-2
@@ -66,7 +66,7 @@ struct LiveLocationRoomTimelineView: View {
|
||||
}
|
||||
}
|
||||
.onTapGesture {
|
||||
guard context.viewState.mapTilerConfiguration.isEnabled,
|
||||
guard context.viewState.mapTilerSettings.isEnabled,
|
||||
timelineItem.content.lastGeoURI != nil,
|
||||
isLive else {
|
||||
return
|
||||
@@ -95,7 +95,7 @@ struct LiveLocationRoomTimelineView: View {
|
||||
private var liveContent: some View {
|
||||
if let geoURI = timelineItem.content.lastGeoURI {
|
||||
MapLibreStaticMapView(geoURI: geoURI,
|
||||
mapURLBuilder: context.viewState.mapTilerConfiguration,
|
||||
mapURLBuilder: context.viewState.mapTilerSettings,
|
||||
attributionPlacement: .topLeft,
|
||||
mapSize: .init(width: mapAspectRatio * mapMaxHeight, height: mapMaxHeight)) {
|
||||
LocationMarkerView(kind: .liveUser(.init(sender: timelineItem.sender)),
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ struct LocationRoomTimelineView: View {
|
||||
.accessibilityElement(children: .ignore)
|
||||
.accessibilityLabel(L10n.commonSharedLocation)
|
||||
.onTapGesture {
|
||||
guard context.viewState.mapTilerConfiguration.isEnabled else { return }
|
||||
guard context.viewState.mapTilerSettings.isEnabled else { return }
|
||||
context.send(viewAction: .mediaTapped(itemID: timelineItem.id))
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ struct LocationRoomTimelineView: View {
|
||||
private var mainContent: some View {
|
||||
if let geoURI = timelineItem.content.geoURI {
|
||||
MapLibreStaticMapView(geoURI: geoURI,
|
||||
mapURLBuilder: context.viewState.mapTilerConfiguration,
|
||||
mapURLBuilder: context.viewState.mapTilerSettings,
|
||||
mapSize: .init(width: mapAspectRatio * mapMaxHeight, height: mapMaxHeight)) {
|
||||
LocationMarkerView(kind: timelineItem.content.kind == .sender ? .staticUser(.init(sender: timelineItem.sender)) : .pin,
|
||||
mediaProvider: context.mediaProvider)
|
||||
|
||||
Reference in New Issue
Block a user