aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-31 02:49:35 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-31 02:49:35 -0600
commit2f9fda4d67fc2de5aa0790074f7b720daecb2898 (patch)
treea85f8fda25406dfb774fe9fa5e5bfe590a960306
parent1b6df3a665605faa4c8b02ec31e7433caad1b0b1 (diff)
downloadetbsa-trackermap-mobile-2f9fda4d67fc2de5aa0790074f7b720daecb2898.tar.gz
etbsa-trackermap-mobile-2f9fda4d67fc2de5aa0790074f7b720daecb2898.tar.bz2
etbsa-trackermap-mobile-2f9fda4d67fc2de5aa0790074f7b720daecb2898.zip
Implemented zoom controls and zoom limits per layer.
Added license headers.
-rw-r--r--iosApp/Localizable.strings28
-rw-r--r--iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstatebin62072 -> 58824 bytes
-rw-r--r--iosApp/iosApp/Devices/DeviceRow.swift25
-rw-r--r--iosApp/iosApp/Devices/DevicesView.swift25
-rw-r--r--iosApp/iosApp/Map/BaseMapView.swift107
-rw-r--r--iosApp/iosApp/Map/MapView.swift25
-rw-r--r--iosApp/iosApp/Map/MapWrapperView.swift31
-rw-r--r--iosApp/iosApp/Session/RootView.swift17
-rw-r--r--iosApp/iosApp/Session/RootViewModel.swift25
-rw-r--r--iosApp/iosApp/Shared/FlowCollector.swift25
-rw-r--r--iosApp/iosApp/Shared/HyperlinkText.swift19
-rw-r--r--iosApp/iosApp/Shared/Inject.swift25
-rw-r--r--iosApp/iosApp/Shared/LoadingView.swift25
-rw-r--r--iosApp/iosApp/Shared/MarkerTransformations.swift25
-rw-r--r--iosApp/iosApp/Shared/Resolver.swift25
-rw-r--r--iosApp/iosApp/Shared/SmallLabelStyle.swift25
-rw-r--r--iosApp/iosApp/Shared/Utils.swift25
-rw-r--r--iosApp/iosApp/Units/UnitsView.swift32
-rw-r--r--iosApp/iosApp/Units/UnitsViewModel.swift25
-rw-r--r--iosApp/iosApp/iOSApp.swift17
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt17
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/MapLayer.kt17
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Marker.kt17
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/UnitInformation.kt17
24 files changed, 482 insertions, 137 deletions
diff --git a/iosApp/Localizable.strings b/iosApp/Localizable.strings
index 30f2ac8..049518f 100644
--- a/iosApp/Localizable.strings
+++ b/iosApp/Localizable.strings
@@ -1,10 +1,20 @@
-/*
- Localizable.strings
- iosApp
-
- Created by Iván on 23/01/22.
- Copyright © 2022 orgName. All rights reserved.
-*/
+/**
+ * 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/>.
+ */
"app-name" = "TrackerMap";
"app-server-url" = "https://etbsa.net/api";
@@ -21,3 +31,7 @@
"reports" = "Reports";
"commands" = "Commands";
"select-action" = "Select an action";
+
+"map-layer" = "Map layer";
+"openstreetmap" = "OpenStreetMap";
+"satellite" = "Satellite";
diff --git a/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstate b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstate
index abb551a..f02d978 100644
--- a/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstate
+++ b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstate
Binary files differ
diff --git a/iosApp/iosApp/Devices/DeviceRow.swift b/iosApp/iosApp/Devices/DeviceRow.swift
index f8c8053..9873c8e 100644
--- a/iosApp/iosApp/Devices/DeviceRow.swift
+++ b/iosApp/iosApp/Devices/DeviceRow.swift
@@ -1,11 +1,20 @@
-//
-// DeviceRow.swift
-// iosApp
-//
-// Created by Iván on 28/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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 shared
diff --git a/iosApp/iosApp/Devices/DevicesView.swift b/iosApp/iosApp/Devices/DevicesView.swift
index 48458ca..e971ac6 100644
--- a/iosApp/iosApp/Devices/DevicesView.swift
+++ b/iosApp/iosApp/Devices/DevicesView.swift
@@ -1,11 +1,20 @@
-//
-// DevicesView.swift
-// iosApp
-//
-// Created by Iván on 28/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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
struct DevicesView: View {
diff --git a/iosApp/iosApp/Map/BaseMapView.swift b/iosApp/iosApp/Map/BaseMapView.swift
index a3d2d70..46e9876 100644
--- a/iosApp/iosApp/Map/BaseMapView.swift
+++ b/iosApp/iosApp/Map/BaseMapView.swift
@@ -1,25 +1,50 @@
-//
-// BaseMapView.swift
-// iosApp
-//
-// Created by Iván on 30/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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 WhirlyGlobeMaplyComponent
+import Combine
import CryptoKit
+import WhirlyGlobeMaplyComponent
import shared
struct BaseMapView: UIViewControllerRepresentable {
typealias UIViewControllerType = MaplyViewController
@Binding var mapLayer: MapLayer
+ var link: BaseMapLink
class Coordinator: NSObject, MaplyViewControllerDelegate {
var parent: BaseMapView
+ var uiViewController: MaplyViewController?
var loader: MaplyQuadImageLoader? = nil
+ // Source: https://stackoverflow.com/questions/65923718
+ var cancellable: AnyCancellable?
+ var link: BaseMapLink? {
+ didSet {
+ cancellable = link?.$action.sink(receiveValue: { action in
+ guard let action = action else {
+ return
+ }
+ self.uiViewController?.action(action)
+ })
+ }
+ }
+
init(_ uiViewController: BaseMapView) {
self.parent = uiViewController
}
@@ -50,21 +75,25 @@ struct BaseMapView: UIViewControllerRepresentable {
sampleParams.minZoom = tileInfo.minZoom
sampleParams.maxZoom = tileInfo.maxZoom
sampleParams.singleLevel = true
+ sampleParams.maxTiles = 25
let loader = MaplyQuadImageLoader(params: sampleParams, tileInfo: tileInfo, viewC: mapViewController)
loader?.baseDrawPriority = kMaplyImageLayerDrawPriorityDefault
loader?.imageFormat = .imageUShort565
context.coordinator.loader = loader
- let point = MaplyCoordinate(x: -100.36 * Float.pi / 180,
- y: 23.191 * Float.pi / 180)
- let height = Float(0.4)
- mapViewController.setPosition(point, height: height)
+ let latitude = 23.191 * Float.pi / 180
+ let longitude = -100.36 * Float.pi / 180
+ let point = MaplyCoordinate(x: longitude, y: latitude)
+ mapViewController.focusOn(point: point, height: 0.4)
return mapViewController
}
func updateUIViewController(_ uiViewController: MaplyViewController, context: Context) {
+ context.coordinator.uiViewController = uiViewController
+ context.coordinator.link = link
+
// MARK: - Set map layer
context.coordinator.loader?.changeTileInfo(tileInfoFrom(layer: mapLayer))
setZoomLimits(uiViewController: uiViewController,
@@ -72,6 +101,8 @@ struct BaseMapView: UIViewControllerRepresentable {
maxZoom: mapLayer.maxZoom)
}
+
+
static func dismantleUIViewController(_ uiViewController: MaplyViewController, coordinator: Coordinator) {
coordinator.loader?.shutdown()
uiViewController.teardown()
@@ -100,3 +131,53 @@ struct BaseMapView: UIViewControllerRepresentable {
)))
}
}
+
+extension MaplyViewController {
+ enum Action {
+ case zoomIn
+ case zoomOut
+ }
+
+ func action(_ action: Action) {
+ switch action {
+ case .zoomIn:
+ zoomIn()
+ case .zoomOut:
+ zoomOut()
+ }
+ }
+
+ func focusOn(point: MaplyCoordinate, height: Float = 0.0000264, animated: Bool = true) {
+ let z = max(height, getMinZoom())
+ if animated {
+ animate(toPosition: point, height: z, time: 0.2)
+ } else {
+ setPosition(point, height: z)
+ }
+ }
+
+ func zoomIn() {
+ let pos = getPosition()
+ let zoom = currentMapScale() / 2
+ focusOn(point: pos, height: height(forMapScale: zoom))
+ }
+
+ func zoomOut() {
+ let pos = getPosition()
+ let zoom = currentMapScale() * 2
+ focusOn(point: pos, height: height(forMapScale: zoom))
+ }
+}
+
+// Source: https://stackoverflow.com/questions/65923718
+class BaseMapLink: ObservableObject {
+ @Published var action: MaplyViewController.Action?
+
+ func zoomIn() {
+ action = .zoomIn
+ }
+
+ func zoomOut() {
+ action = .zoomOut
+ }
+}
diff --git a/iosApp/iosApp/Map/MapView.swift b/iosApp/iosApp/Map/MapView.swift
index 33b9932..c5bbc8a 100644
--- a/iosApp/iosApp/Map/MapView.swift
+++ b/iosApp/iosApp/Map/MapView.swift
@@ -1,11 +1,20 @@
-//
-// MapView.swift
-// iosApp
-//
-// Created by Iván on 28/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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 shared
diff --git a/iosApp/iosApp/Map/MapWrapperView.swift b/iosApp/iosApp/Map/MapWrapperView.swift
index 2a99f87..e9133eb 100644
--- a/iosApp/iosApp/Map/MapWrapperView.swift
+++ b/iosApp/iosApp/Map/MapWrapperView.swift
@@ -1,22 +1,33 @@
-//
-// MapWrapperView.swift
-// iosApp
-//
-// Created by Iván on 30/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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
+ @ObservedObject var link: BaseMapLink = BaseMapLink()
var body: some View {
ZStack {
// MARK: - Map
- BaseMapView(mapLayer: $layer)
+ BaseMapView(mapLayer: $layer, link: link)
// MARK: - Attribution
VStack {
@@ -37,6 +48,7 @@ struct MapWrapperView: View {
Group {
Button {
print ("Zoom in!")
+ link.zoomIn()
} label: {
Image(systemName: "plus")
.imageScale(.large)
@@ -44,6 +56,7 @@ struct MapWrapperView: View {
Button {
print("Zoom out!")
+ link.zoomOut()
} label: {
Image(systemName: "minus")
.imageScale(.large)
diff --git a/iosApp/iosApp/Session/RootView.swift b/iosApp/iosApp/Session/RootView.swift
index 1be724a..9f2e589 100644
--- a/iosApp/iosApp/Session/RootView.swift
+++ b/iosApp/iosApp/Session/RootView.swift
@@ -1,3 +1,20 @@
+/**
+ * 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 shared
diff --git a/iosApp/iosApp/Session/RootViewModel.swift b/iosApp/iosApp/Session/RootViewModel.swift
index 9c664ef..25a170f 100644
--- a/iosApp/iosApp/Session/RootViewModel.swift
+++ b/iosApp/iosApp/Session/RootViewModel.swift
@@ -1,11 +1,20 @@
-//
-// LoginViewModel.swift
-// iosApp
-//
-// Created by Iván on 27/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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 Foundation
import shared
diff --git a/iosApp/iosApp/Shared/FlowCollector.swift b/iosApp/iosApp/Shared/FlowCollector.swift
index 1613f20..628c0cd 100644
--- a/iosApp/iosApp/Shared/FlowCollector.swift
+++ b/iosApp/iosApp/Shared/FlowCollector.swift
@@ -1,11 +1,20 @@
-//
-// FlowCollector.swift
-// iosApp
-//
-// Created by Iván on 23/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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 Foundation
import shared
diff --git a/iosApp/iosApp/Shared/HyperlinkText.swift b/iosApp/iosApp/Shared/HyperlinkText.swift
index 4b966eb..69c758b 100644
--- a/iosApp/iosApp/Shared/HyperlinkText.swift
+++ b/iosApp/iosApp/Shared/HyperlinkText.swift
@@ -1,7 +1,24 @@
-// Source: https://swiftuirecipes.com/blog/hyperlinks-in-swiftui-text
+/**
+ * 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 SwiftUIFlowLayout
+// Source: https://swiftuirecipes.com/blog/hyperlinks-in-swiftui-text
struct HyperlinkText: View {
private let pairs: [StringWithAttributes]
diff --git a/iosApp/iosApp/Shared/Inject.swift b/iosApp/iosApp/Shared/Inject.swift
index 0aaa388..5b292b0 100644
--- a/iosApp/iosApp/Shared/Inject.swift
+++ b/iosApp/iosApp/Shared/Inject.swift
@@ -1,11 +1,20 @@
-//
-// Inject.swift
-// iosApp
-//
-// Created by Iván on 26/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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 Foundation
import shared
diff --git a/iosApp/iosApp/Shared/LoadingView.swift b/iosApp/iosApp/Shared/LoadingView.swift
index 1825113..ef88f99 100644
--- a/iosApp/iosApp/Shared/LoadingView.swift
+++ b/iosApp/iosApp/Shared/LoadingView.swift
@@ -1,11 +1,20 @@
-//
-// LoadingView.swift
-// iosApp
-//
-// Created by Iván on 27/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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
struct LoadingView: UIViewRepresentable {
diff --git a/iosApp/iosApp/Shared/MarkerTransformations.swift b/iosApp/iosApp/Shared/MarkerTransformations.swift
index b4aaa90..2e71980 100644
--- a/iosApp/iosApp/Shared/MarkerTransformations.swift
+++ b/iosApp/iosApp/Shared/MarkerTransformations.swift
@@ -1,11 +1,20 @@
-//
-// MarkerTransformations.swift
-// iosApp
-//
-// Created by Iván on 29/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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 shared
diff --git a/iosApp/iosApp/Shared/Resolver.swift b/iosApp/iosApp/Shared/Resolver.swift
index 411dc13..3935405 100644
--- a/iosApp/iosApp/Shared/Resolver.swift
+++ b/iosApp/iosApp/Shared/Resolver.swift
@@ -1,11 +1,20 @@
-//
-// Resolver.swift
-// iosApp
-//
-// Created by Iván on 26/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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 Foundation
import shared
diff --git a/iosApp/iosApp/Shared/SmallLabelStyle.swift b/iosApp/iosApp/Shared/SmallLabelStyle.swift
index 27914ff..51308e0 100644
--- a/iosApp/iosApp/Shared/SmallLabelStyle.swift
+++ b/iosApp/iosApp/Shared/SmallLabelStyle.swift
@@ -1,11 +1,20 @@
-//
-// SmallIconLabelStyle.swift
-// iosApp
-//
-// Created by Iván on 29/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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
struct SmallLabelStyle: LabelStyle {
diff --git a/iosApp/iosApp/Shared/Utils.swift b/iosApp/iosApp/Shared/Utils.swift
index cacf49b..625b082 100644
--- a/iosApp/iosApp/Shared/Utils.swift
+++ b/iosApp/iosApp/Shared/Utils.swift
@@ -1,11 +1,20 @@
-//
-// Utils.swift
-// iosApp
-//
-// Created by Iván on 30/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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 Foundation
import CryptoKit
diff --git a/iosApp/iosApp/Units/UnitsView.swift b/iosApp/iosApp/Units/UnitsView.swift
index 33598c3..0ad84d9 100644
--- a/iosApp/iosApp/Units/UnitsView.swift
+++ b/iosApp/iosApp/Units/UnitsView.swift
@@ -1,11 +1,20 @@
-//
-// UnitsView.swift
-// iosApp
-//
-// Created by Iván on 27/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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 SwiftUIX
import shared
@@ -46,10 +55,10 @@ struct UnitsView: View {
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Menu {
- Picker (selection: $unitsViewModel.mapLayerType, label: Text("Map layer")) {
- Text("OpenStreetMap")
+ Picker (selection: $unitsViewModel.mapLayerType, label: Text("map-layer")) {
+ Text("openstreetmap")
.tag(MapLayer.companion.layers[MapLayer.Type_.streets]!)
- Text("Satellite")
+ Text("satellite")
.tag(MapLayer.companion.layers[MapLayer.Type_.satellite]!)
}
} label: {
@@ -64,6 +73,7 @@ struct UnitsView: View {
}
}
}
+ .navigationViewStyle(StackNavigationViewStyle())
}
private func getNavigationTitle(_ unitDisplayMode: UnitsViewModel.UnitsDisplayMode) -> LocalizedStringKey {
diff --git a/iosApp/iosApp/Units/UnitsViewModel.swift b/iosApp/iosApp/Units/UnitsViewModel.swift
index f7e1a21..33f9729 100644
--- a/iosApp/iosApp/Units/UnitsViewModel.swift
+++ b/iosApp/iosApp/Units/UnitsViewModel.swift
@@ -1,11 +1,20 @@
-//
-// UnitsViewModel.swift
-// iosApp
-//
-// Created by Iván on 28/01/22.
-// Copyright © 2022 orgName. All rights reserved.
-//
-
+/**
+ * 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 Foundation
import WhirlyGlobeMaplyComponent
import shared
diff --git a/iosApp/iosApp/iOSApp.swift b/iosApp/iosApp/iOSApp.swift
index 9b21276..6bf6710 100644
--- a/iosApp/iosApp/iOSApp.swift
+++ b/iosApp/iosApp/iOSApp.swift
@@ -1,3 +1,20 @@
+/**
+ * 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 Foundation
import SwiftUI
import shared
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt
index a008fa8..17682b8 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt
@@ -1,3 +1,20 @@
+/**
+ * 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/>.
+ */
package mx.trackermap.TrackerMap.client.models
import kotlinx.serialization.Serializable
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/MapLayer.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/MapLayer.kt
index ff0489e..3266c0b 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/MapLayer.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/MapLayer.kt
@@ -1,3 +1,20 @@
+/**
+ * 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/>.
+ */
package mx.trackermap.TrackerMap.client.models
data class MapLayer(
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Marker.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Marker.kt
index b227b05..ff3fb29 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Marker.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Marker.kt
@@ -1,3 +1,20 @@
+/**
+ * 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/>.
+ */
package mx.trackermap.TrackerMap.client.models
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/UnitInformation.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/UnitInformation.kt
index 47134a6..a276fda 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/UnitInformation.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/UnitInformation.kt
@@ -1,3 +1,20 @@
+/**
+ * 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/>.
+ */
package mx.trackermap.TrackerMap.client.models
data class UnitInformation(