aboutsummaryrefslogtreecommitdiff
path: root/iosApp/iosApp/Map/MapWrapperView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'iosApp/iosApp/Map/MapWrapperView.swift')
-rw-r--r--iosApp/iosApp/Map/MapWrapperView.swift63
1 files changed, 63 insertions, 0 deletions
diff --git a/iosApp/iosApp/Map/MapWrapperView.swift b/iosApp/iosApp/Map/MapWrapperView.swift
new file mode 100644
index 0000000..2a99f87
--- /dev/null
+++ b/iosApp/iosApp/Map/MapWrapperView.swift
@@ -0,0 +1,63 @@
+//
+// MapWrapperView.swift
+// iosApp
+//
+// Created by Iván on 30/01/22.
+// Copyright © 2022 orgName. All rights reserved.
+//
+
+import SwiftUI
+import WhirlyGlobeMaplyComponent
+import shared
+
+struct MapWrapperView: View {
+ @Binding var layer: MapLayer
+
+ var body: some View {
+ ZStack {
+ // MARK: - Map
+ BaseMapView(mapLayer: $layer)
+
+ // MARK: - Attribution
+ VStack {
+ HyperlinkText(html: layer.attribution)
+ .font(.footnote)
+ .lineLimit(3)
+ .foregroundColor(.label.opacity(0.35))
+ .padding()
+ .background(.systemBackground.opacity(0.35))
+ }
+ .frame(maxWidth: .infinity,
+ maxHeight: .infinity,
+ alignment: .bottom)
+ .allowsHitTesting(false)
+
+ // MARK: - Controls
+ VStack {
+ Group {
+ Button {
+ print ("Zoom in!")
+ } label: {
+ Image(systemName: "plus")
+ .imageScale(.large)
+ }
+
+ Button {
+ print("Zoom out!")
+ } label: {
+ Image(systemName: "minus")
+ .imageScale(.large)
+ }
+ }
+ .frame(width: 50, height: 50)
+ .foregroundColor(.primary)
+ .background(.systemBackground)
+ .clipShape(Circle())
+ }
+ .frame(maxWidth: .infinity,
+ maxHeight: .infinity,
+ alignment: .topTrailing)
+ .padding()
+ }
+ }
+}