From 2f9fda4d67fc2de5aa0790074f7b720daecb2898 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Mon, 31 Jan 2022 02:49:35 -0600 Subject: Implemented zoom controls and zoom limits per layer. Added license headers. --- iosApp/Localizable.strings | 28 ++++-- .../UserInterfaceState.xcuserstate | Bin 62072 -> 58824 bytes iosApp/iosApp/Devices/DeviceRow.swift | 25 +++-- iosApp/iosApp/Devices/DevicesView.swift | 25 +++-- iosApp/iosApp/Map/BaseMapView.swift | 107 ++++++++++++++++++--- iosApp/iosApp/Map/MapView.swift | 25 +++-- iosApp/iosApp/Map/MapWrapperView.swift | 31 ++++-- iosApp/iosApp/Session/RootView.swift | 17 ++++ iosApp/iosApp/Session/RootViewModel.swift | 25 +++-- iosApp/iosApp/Shared/FlowCollector.swift | 25 +++-- iosApp/iosApp/Shared/HyperlinkText.swift | 19 +++- iosApp/iosApp/Shared/Inject.swift | 25 +++-- iosApp/iosApp/Shared/LoadingView.swift | 25 +++-- iosApp/iosApp/Shared/MarkerTransformations.swift | 25 +++-- iosApp/iosApp/Shared/Resolver.swift | 25 +++-- iosApp/iosApp/Shared/SmallLabelStyle.swift | 25 +++-- iosApp/iosApp/Shared/Utils.swift | 25 +++-- iosApp/iosApp/Units/UnitsView.swift | 32 +++--- iosApp/iosApp/Units/UnitsViewModel.swift | 25 +++-- iosApp/iosApp/iOSApp.swift | 17 ++++ .../TrackerMap/client/models/EventInformation.kt | 17 ++++ .../TrackerMap/client/models/MapLayer.kt | 17 ++++ .../trackermap/TrackerMap/client/models/Marker.kt | 17 ++++ .../TrackerMap/client/models/UnitInformation.kt | 17 ++++ 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 , Henoch Ojeda + * + * 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 . + */ "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 Binary files a/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstate and b/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/avalos.xcuserdatad/UserInterfaceState.xcuserstate 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ 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 , Henoch Ojeda + * + * 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 . + */ package mx.trackermap.TrackerMap.client.models data class UnitInformation( -- cgit v1.2.3