diff options
| author | ivar <i@oiee.no> | 2025-10-20 00:26:34 +0200 |
|---|---|---|
| committer | ivar <i@oiee.no> | 2025-10-20 00:26:34 +0200 |
| commit | a1f0518d0cd123a791adde64f4f11bd8e44276c7 (patch) | |
| tree | 675a7dff8262eea877ec800ff1efe9b92f5d7e7d /ios/Hæ-appen/MapContentView.swift | |
| download | what-a1f0518d0cd123a791adde64f4f11bd8e44276c7.tar.xz what-a1f0518d0cd123a791adde64f4f11bd8e44276c7.zip | |
Initial commit
Diffstat (limited to 'ios/Hæ-appen/MapContentView.swift')
| -rw-r--r-- | ios/Hæ-appen/MapContentView.swift | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/ios/Hæ-appen/MapContentView.swift b/ios/Hæ-appen/MapContentView.swift new file mode 100644 index 0000000..4d35dfe --- /dev/null +++ b/ios/Hæ-appen/MapContentView.swift @@ -0,0 +1,45 @@ +// +// ContentView.swift +// Hæ-appen +// +// Created by Ivar Løvlie on 16/09/2025. +// + +import SwiftUI +import MapKit + + +struct MapContentView: View { + @Namespace var mapScope + @State private var position: MapCameraPosition = .automatic + var annotationStringKey: LocalizedStringKey = "Annotation" + var annotationCoordinate: CLLocationCoordinate2D = CLLocationCoordinate2D.init() + let symbolSet: [String] = ["cloud.bolt.rain.fill", "sun.rain.fill", "moon.stars.fill", "moon.fill"] + + var body: some View { + if #available(iOS 26, *) { + VStack { + Map(initialPosition: .userLocation(fallback: position), scope: mapScope) + }.safeAreaInset(edge: .trailing) { + GlassEffectContainer(spacing: 10.0) { + HStack(spacing: 20.0) { + ForEach(symbolSet.indices, id: \.self) { item in + Image(systemName: symbolSet[item]) + .frame(width: 80.0, height: 80.0) + .font(.system(size: 36)) + .glassEffect() + .glassEffectUnion(id: item < 2 ? "1" : "2", namespace: mapScope) + } + } + } + }.mapScope(mapScope) + .task { + LocationAuthorizer.shared.requestWhenInUse() + } + } + } +} + +#Preview { + MapContentView() +} |
