Clarify how the different mapLibre URLs are used.

This commit is contained in:
Stefan Ceriu
2025-11-10 15:13:19 +02:00
committed by Stefan Ceriu
parent 6465730638
commit dd95a4313a
5 changed files with 47 additions and 45 deletions
@@ -65,7 +65,7 @@ struct MapLibreMapView: UIViewRepresentable {
// Don't set the same value twice. Otherwise, if there is an error loading the map, a loop
// is caused as the `error` binding being set, which triggers this update, which sets a
// new URL, which causes another error, and so it goes on round and round in a circle.
let dynamicMapURL = mapURLBuilder.dynamicMapURL(for: .init(colorScheme))
let dynamicMapURL = mapURLBuilder.interactiveMapURL(for: .init(colorScheme))
if mapView.styleURL != dynamicMapURL {
mapView.styleURL = dynamicMapURL
}
@@ -86,7 +86,7 @@ struct MapLibreMapView: UIViewRepresentable {
}
private func makeMapView() -> MGLMapView {
let mapView = MGLMapView(frame: .zero, styleURL: mapURLBuilder.dynamicMapURL(for: colorScheme == .dark ? .dark : .light))
let mapView = MGLMapView(frame: .zero, styleURL: mapURLBuilder.interactiveMapURL(for: colorScheme == .dark ? .dark : .light))
mapView.logoViewPosition = .topLeft
mapView.attributionButtonPosition = .topLeft
mapView.attributionButtonMargins = .init(x: mapView.logoView.frame.maxX + 8, y: mapView.logoView.center.y / 2)