diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-02-03 02:33:50 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-02-03 02:33:50 -0600 |
commit | 48e9f6e38213c533286d83e426346471d507467d (patch) | |
tree | fa19d37b1ccdcd17ea40181ae3bef6abedb2450e /iosApp/iosApp/Map/MapWrapperView.swift | |
parent | 416be1cc70494737efc2fc2409c889db314d7fdd (diff) | |
download | etbsa-trackermap-mobile-48e9f6e38213c533286d83e426346471d507467d.tar.gz etbsa-trackermap-mobile-48e9f6e38213c533286d83e426346471d507467d.tar.bz2 etbsa-trackermap-mobile-48e9f6e38213c533286d83e426346471d507467d.zip |
WIP: rewrote MapWrapperView + MapView as unified UIKit view controller
Diffstat (limited to 'iosApp/iosApp/Map/MapWrapperView.swift')
-rw-r--r-- | iosApp/iosApp/Map/MapWrapperView.swift | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/iosApp/iosApp/Map/MapWrapperView.swift b/iosApp/iosApp/Map/MapWrapperView.swift deleted file mode 100644 index 7450eed..0000000 --- a/iosApp/iosApp/Map/MapWrapperView.swift +++ /dev/null @@ -1,87 +0,0 @@ -/** - * TrackerMap - * Copyright (C) 2021-2022 Iván Ávalos <avalos@disroot.org>, Henoch Ojeda <imhenoch@protonmail.com> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ -import SwiftUI -import Combine -import WhirlyGlobeMaplyComponent -import shared - -struct MapWrapperView: View { - @Binding var layer: MapLayer - @Binding var markers: [Marker] - var markerCallback: ((Int32?) -> Void)? - @ObservedObject var link: BaseMapLink = BaseMapLink() - - var body: some View { - ZStack { - // MARK: - Map - MapView(mapLayer: $layer, - markers: $markers, - markerCallback: markerCallback, - link: link) - - // MARK: - Attribution - VStack { - HyperlinkText(html: layer.attribution) - .font(.footnote) - .lineLimit(3) - .foregroundColor(.label.opacity(0.35)) - .padding(6.0) - .background(.systemBackground.opacity(0.35)) - } - .frame(maxWidth: .infinity, - maxHeight: .infinity, - alignment: .bottom) - .allowsHitTesting(false) - - // MARK: - Controls - VStack { - // MARK: Zoom in - Button { - print ("Zoom in!") - link.zoomIn() - } label: { - Image(systemName: "plus").imageScale(.large) - } - .buttonStyle(ControlButtonStyle()) - - // MARK: Zoom out - Button { - print("Zoom out!") - link.zoomOut() - } label: { - Image(systemName: "minus").imageScale(.large) - } - .buttonStyle(ControlButtonStyle()) - } - .frame(maxWidth: .infinity, - maxHeight: .infinity, - alignment: .topTrailing) - .padding() - } - } -} - -struct ControlButtonStyle: ButtonStyle { - func makeBody(configuration: Configuration) -> some View { - configuration.label - .frame(width: 50, height: 50) - .foregroundColor(configuration.isPressed ? .secondary : .primary) - .background(configuration.isPressed ? .secondarySystemBackground : .systemBackground) - .clipShape(Circle()) - } -} |