Set map tiler URL from well known if available (#5633)

This commit is contained in:
Mauro
2026-05-28 15:24:58 +02:00
committed by GitHub
parent 594d041128
commit 7093d966b4
25 changed files with 291 additions and 88 deletions
@@ -144,7 +144,7 @@ final class AppSettings: @unchecked Sendable {
accountProvisioningHost: String,
bugReportApplicationID: String,
analyticsTermsURL: URL?,
mapTilerConfiguration: MapTilerConfiguration) {
mapTilerConfiguration: MapTilerSettings.Configuration) {
self.accountProviders = accountProviders
self.allowOtherAccountProviders = allowOtherAccountProviders
self.hideBrandChrome = hideBrandChrome
@@ -164,7 +164,7 @@ final class AppSettings: @unchecked Sendable {
self.accountProvisioningHost = accountProvisioningHost
self.bugReportApplicationID = bugReportApplicationID
self.analyticsTermsURL = analyticsTermsURL
self.mapTilerConfiguration = mapTilerConfiguration
mapTilerSettings = RemotePreference(.configuration(mapTilerConfiguration))
}
// MARK: - Application
@@ -399,11 +399,16 @@ final class AppSettings: @unchecked Sendable {
// MARK: - Maps
/// maptiler base url
private(set) var mapTilerConfiguration = MapTilerConfiguration(baseURL: "https://api.maptiler.com/maps",
apiKey: Secrets.mapLibreAPIKey,
lightStyleID: "9bc819c8-e627-474a-a348-ec144fe3d810",
darkStyleID: "dea61faf-292b-4774-9660-58fcef89a7f3")
/// The locally-bundled MapTiler configuration.
static let bundledMapTilerConfiguration = MapTilerSettings.Configuration(baseURL: "https://api.maptiler.com/maps",
apiKey: Secrets.mapLibreAPIKey,
lightStyleID: "9bc819c8-e627-474a-a348-ec144fe3d810",
darkStyleID: "dea61faf-292b-4774-9660-58fcef89a7f3")
/// The resolved map tile settings. Defaults to ``MapTilerSettings.configuration(_:)`` with the
/// bundled configuration and is remotely overridden with ``MapTilerSettings.url(_:)`` when
/// the homeserver advertises a `style.json` URL via the matrix client well-known.
private(set) var mapTilerSettings = RemotePreference<MapTilerSettings>(.configuration(AppSettings.bundledMapTilerConfiguration))
// MARK: - Presence