diff --git a/Database/Sources/App/Controllers/MapsController.swift b/Database/Sources/App/Controllers/MapsController.swift index f705d595..6ef60321 100644 --- a/Database/Sources/App/Controllers/MapsController.swift +++ b/Database/Sources/App/Controllers/MapsController.swift @@ -32,6 +32,7 @@ struct MapsController: RouteCollection { return map.save(on: req.db).map { map } } + func getAllHandler(_ req: Request) -> EventLoopFuture<[Map]> { Map.query(on: req.db).all() } @@ -59,6 +60,7 @@ struct MapsController: RouteCollection { return PublicMap(id: map.id!, name: map.name, initialLocationLatitude: map.initialLocationLatitude, initialLocationLongitude: map.initialLocationLongitude, mountainReportUrl: map.mountainReportUrl, trailStatusElementId: map.trailStatusElementId, liftStatusElementId: map.liftStatusElementId, mapTrail: publicMapTrails, mapConnector: publicMapConnectors) } + func getMapTrailsHandler(_ req: Request) -> EventLoopFuture<[MapTrail]> { // 2 @@ -70,7 +72,6 @@ struct MapsController: RouteCollection { } } - func getMapConnectorsHandler(_ req: Request) -> EventLoopFuture<[MapConnector]> { Map.find(req.parameters.get("mapId"), on: req.db) .unwrap(or: Abort(.notFound)) @@ -112,6 +113,7 @@ struct MapsController: RouteCollection { return .noContent } + func deleteAllHandler(_ req: Request) async throws -> HTTPStatus { let maps = try await Map.query(on: req.db).all() diff --git a/Database/Sources/App/Controllers/PointsController.swift b/Database/Sources/App/Controllers/PointsController.swift index 611b3a90..f760204a 100644 --- a/Database/Sources/App/Controllers/PointsController.swift +++ b/Database/Sources/App/Controllers/PointsController.swift @@ -19,7 +19,7 @@ struct PointsController: RouteCollection { pointsRoute.delete(":pointId", use: deleteHandler) pointsRoute.delete( use: deleteAllHandler) pointsRoute.put(":pointId", use: updateHandler) - + } func createHandler(_ req: Request) @@ -28,15 +28,18 @@ struct PointsController: RouteCollection { let point = Point(latitude: data.latitude, longitude: data.longitude, mapTrailID: data.mapTrailId, mapConnectorID: data.mapConnectorId, time: data.time, order: data.order) return point.save(on: req.db).map { point } } + func getAllHandler(_ req: Request) -> EventLoopFuture<[Point]> { Point.query(on: req.db).all() } + func getHandler(_ req: Request) -> EventLoopFuture { Point.find(req.parameters.get("pointId"), on: req.db) .unwrap(or: Abort(.notFound)) } + func deleteHandler(_ req: Request) -> EventLoopFuture { Point.find(req.parameters.get("pointId"), on: req.db) .unwrap(or: Abort(.notFound)) @@ -44,16 +47,24 @@ struct PointsController: RouteCollection { point.delete(on: req.db).transform(to: .noContent) } } - func updateHandler(_ req: Request) throws -> EventLoopFuture { - let updatedPoint = try req.content.decode(updatePointTimeData.self) - return Point.find(req.parameters.get("pointId"), on: req.db) - .unwrap(or: Abort(.notFound)).flatMap { point in - point.time = updatedPoint.time - return point.save(on: req.db).map{ - point - } - } + + func updateHandler(_ req: Request) async throws -> Point { + guard let point = try? await Point.find(req.parameters.get("pointId"), on: req.db) else { + throw Abort(.notFound) + } + let updatedPointData = try req.content.decode(updatePointTimeData.self) + + point.time = updatedPointData.time + do { + try await point.update(on: req.db) + } catch { + print("ERROR: ", error) + } + + return point + } + func deleteAllHandler(_ req: Request) ->EventLoopFuture { Point.query(on: req.db) .delete(force: true).transform(to: .noContent) @@ -64,11 +75,11 @@ struct CreatePointData: Content{ let latitude: Float let longitude: Float let mapTrailId: UUID? - let time: [Float] + let time: [Double] let mapConnectorId: UUID? let order: Int } struct updatePointTimeData: Content { - let time: [Float] + let time: [Double] } diff --git a/Database/Sources/App/Controllers/UsersController.swift b/Database/Sources/App/Controllers/UsersController.swift index 044014f3..5f3022d2 100644 --- a/Database/Sources/App/Controllers/UsersController.swift +++ b/Database/Sources/App/Controllers/UsersController.swift @@ -43,6 +43,7 @@ struct UsersController: RouteCollection } } + // 5 func createHandler(_ req: Request) throws -> EventLoopFuture { @@ -57,18 +58,21 @@ struct UsersController: RouteCollection } return user.save(on: req.db).map{ user } - + } } + func getAllHandler(_ req: Request) -> EventLoopFuture<[User]> { User.query(on: req.db).all() } + func getHandler(_ req: Request) -> EventLoopFuture { // 4 User.find(req.parameters.get("userID"), on: req.db) .unwrap(or: Abort(.notFound)) } + func getTrailReportsHandler(_ req: Request) -> EventLoopFuture<[TrailReport]> { // 2 @@ -79,6 +83,7 @@ struct UsersController: RouteCollection user.$trailReports.get(on: req.db) } } + func getUserLocationsHandler(_ req: Request) -> EventLoopFuture<[UserLocation]> { // 2 @@ -89,6 +94,7 @@ struct UsersController: RouteCollection user.$userLocations.get(on: req.db) } } + func updateHandler(_ req: Request) throws -> EventLoopFuture { let updatedUser = try req.content.decode(User.self) return User.find(req.parameters.get("userID"), on: req.db) @@ -100,6 +106,7 @@ struct UsersController: RouteCollection } } } + func getUserRoutesHandler(_ req: Request) -> EventLoopFuture<[UserRoute]> { // 2 @@ -123,10 +130,10 @@ struct UsersController: RouteCollection .delete(force: true).transform(to: .noContent) } -// func login(req: Request) throws -> User { -// print(req) -// return try req.auth.require(User.self) -// } + // func login(req: Request) throws -> User { + // print(req) + // return try req.auth.require(User.self) + // } func checkIfUserExists(_ username: String, req: Request) -> EventLoopFuture { User.query(on: req.db).filter(\.$username == username).first().map({ $0 != nil }) } diff --git a/Database/Sources/App/Migrations/CreatePoints.swift b/Database/Sources/App/Migrations/CreatePoints.swift index 656afc64..2f5c8ea8 100644 --- a/Database/Sources/App/Migrations/CreatePoints.swift +++ b/Database/Sources/App/Migrations/CreatePoints.swift @@ -21,7 +21,7 @@ struct CreatePoints: Migration { .field("order", .int, .required) - .field("time", .array(of: .float), .required) + .field("time", .array(of: .double), .required) .field("mapTrailID", .uuid, .references("mapTrails", "id")) diff --git a/Database/Sources/App/Models/Point.swift b/Database/Sources/App/Models/Point.swift index ea2fa037..41b9e47e 100644 --- a/Database/Sources/App/Models/Point.swift +++ b/Database/Sources/App/Models/Point.swift @@ -24,7 +24,7 @@ final class Point: Model, Content { var order: Int @Field(key: "time") - var time: [Float] + var time: [Double] @OptionalParent(key: "mapTrailID") var mapTrail: MapTrail? @@ -34,7 +34,7 @@ final class Point: Model, Content { init() {} - init(id: UUID? = nil, latitude: Float, longitude: Float, mapTrailID: MapTrail.IDValue?, mapConnectorID: MapConnector.IDValue?, time: [Float], order: Int) { + init(id: UUID? = nil, latitude: Float, longitude: Float, mapTrailID: MapTrail.IDValue?, mapConnectorID: MapConnector.IDValue?, time: [Double], order: Int) { self.latitude = latitude self.longitude = longitude self.$mapTrail.id = mapTrailID diff --git a/MapsInterpreter/kmlInterpreter.py b/MapsInterpreter/kmlInterpreter.py index 023a3879..e11970bd 100644 --- a/MapsInterpreter/kmlInterpreter.py +++ b/MapsInterpreter/kmlInterpreter.py @@ -30,7 +30,7 @@ def save_mountain_to_database(mapInfo: MapInfo): jsonMap = {'name': name, 'initialLocationLatitude': iniitalLocationLatitude, 'initialLocationLongitude': initialLocationLongitude, 'mountainReportUrl': mountainReportUrl, 'trailStatusElementId': trailStatusElementId, 'liftStatusElementId': liftStatusElementId} #35.172.135.117 - baseURL = "http://35.172.13/api" + baseURL = "http://localhost:8080/api" mapUrl = baseURL + '/maps' mapConnectorURL = baseURL + '/map-connectors' mapTrailURL = baseURL + '/map-trails' @@ -51,7 +51,7 @@ def save_mountain_to_database(mapInfo: MapInfo): for idx, coordinate in enumerate(e.geometry.coords): lat = coordinate[1] long = coordinate[0] - mapConnectorPoint = {'latitude': lat, 'longitude': long, 'time': [], 'mapConnectorId': mapConnector.json().get('id'), 'order': idx} + mapConnectorPoint = {'latitude': lat, 'longitude': long, 'time': [0.0], 'mapConnectorId': mapConnector.json().get('id'), 'order': idx} mc = requests.post(mapPointURL, json= mapConnectorPoint) else : print(e.name) @@ -65,11 +65,11 @@ def save_mountain_to_database(mapInfo: MapInfo): for idx, coordinate in enumerate(e.geometry.coords): lat = coordinate[1] long = coordinate[0] - mapTrailPoint = {'latitude': lat, 'longitude': long, 'time': [], 'mapTrailId': mapTrail.json().get('id'), 'order': idx} + mapTrailPoint = {'latitude': lat, 'longitude': long, 'time': [0.0], 'mapTrailId': mapTrail.json().get('id'), 'order': idx} mt = requests.post(mapPointURL, json= mapTrailPoint) print("Completed " + str(index) + " out of " + str(len(list(folder.features()))) + " " + folder.name + " trails") -mountains = [sugarloaf] +mountains = [sugarloaf, sr] for mountain in mountains: save_mountain_to_database(mountain) \ No newline at end of file diff --git a/TrailblazerIOS/API/PointAPI.swift b/TrailblazerIOS/API/PointAPI.swift index 1491f879..bbbaf8ff 100644 --- a/TrailblazerIOS/API/PointAPI.swift +++ b/TrailblazerIOS/API/PointAPI.swift @@ -10,7 +10,7 @@ import Foundation extension APIHandler { func updatePointTime(point: PointTimeUpdateData, completion: @escaping (Result) -> Void) { - let url = URL(string: "\(self.baseURL)/api/users/\(point.id)")! + let url = URL(string: "\(self.baseURL)/api/points/\(point.id)")! let encoder = JSONEncoder() @@ -22,11 +22,12 @@ extension APIHandler { URLSession.shared.dataTask(with: request) { data, response, error in if let data = data { let decoder = JSONDecoder() - if let point = try? decoder.decode(Point.self, from: data) { + do { + let point = try decoder.decode(Point.self, from: data) completion(.success(point)) - } else { - completion(.failure(DecodingErrors.pointDecodingError)) - print("Could not update user") + } catch { + print("Could not update point") + completion(.failure(error)) } } }.resume() diff --git a/TrailblazerIOS/Models/Point.swift b/TrailblazerIOS/Models/Point.swift index 108d749a..127c5775 100644 --- a/TrailblazerIOS/Models/Point.swift +++ b/TrailblazerIOS/Models/Point.swift @@ -14,12 +14,12 @@ struct Point: Codable { var latitude: Float var longitude: Float var distance: Float? - var time: [Float] = [] + var time: [Double] = [] var order: Int } struct PointTimeUpdateData: Codable{ var id: String - var time: [Float] + var time: [Double] } diff --git a/TrailblazerIOS/Singletons/MapInterpreter.swift b/TrailblazerIOS/Singletons/MapInterpreter.swift index e7213753..11f9531c 100644 --- a/TrailblazerIOS/Singletons/MapInterpreter.swift +++ b/TrailblazerIOS/Singletons/MapInterpreter.swift @@ -9,7 +9,7 @@ final class MapInterpreter: NSObject { var distanceGraph = EdgeWeightedDigraph() var baseLiftVertexes = [Vertex]() let baseURL = APIHandler.shared.baseURL - + var trailReports = [TrailReport]() func createMap(map: Map) { self.mapView.removeOverlays(self.mapView.overlays) @@ -47,7 +47,7 @@ final class MapInterpreter: NSObject { { coordinates.append(CLLocationCoordinate2D(latitude: Double(point.latitude), longitude: Double(point.longitude))) pointIds.append(point.id!) - trailTimes.append(point.time as! [Double]) + trailTimes.append(point.time) } let polyline = CustomPolyline(coordinates: coordinates, count: coordinates.count) @@ -55,8 +55,10 @@ final class MapInterpreter: NSObject { polyline.color = color let initialAnnotation = createAnnotation(title: trail.name, latitude: coordinates[0].latitude, longitude: coordinates[0].longitude, difficulty: difficulty) + initialAnnotation.id = trail.points[0].id initialAnnotation.trailTimes = trailTimes initialAnnotation.ids = pointIds + initialAnnotation.times = trail.points[0].time self.mapView.addAnnotation(initialAnnotation) polyline.initialAnnotation = initialAnnotation polylines.append(polyline) @@ -71,13 +73,15 @@ final class MapInterpreter: NSObject { { coordinates.append(CLLocationCoordinate2D(latitude: Double(point.latitude), longitude: Double(point.longitude))) pointIds.append(point.id!) - trailTimes.append(point.time as! [Double]) + trailTimes.append(point.time) } let initialAnnotation = createAnnotation(title: connector.name, latitude: coordinates[0].latitude, longitude: coordinates[0].longitude, difficulty: .easy) + initialAnnotation.id = connector.points[0].id initialAnnotation.isConnector = true initialAnnotation.trailTimes = trailTimes initialAnnotation.ids = pointIds + initialAnnotation.times = connector.points[0].time let polyline = CustomPolyline(coordinates: coordinates, count: coordinates.count) polyline.title = connector.name @@ -98,14 +102,17 @@ final class MapInterpreter: NSObject { private func createVertices(polylines: [CustomPolyline]) -> [Vertex] { var foundTrails : [String] = [] var vertices = [Vertex]() + self.mapView.removeAnnotations(self.mapView.overlays) + self.baseLiftVertexes.removeAll() for polylineIndex in 0...polylines.count - 1 { - guard let initialAnnotation = polylines[polylineIndex].initialAnnotation else { + let overlay = polylines[polylineIndex] + + guard let initialAnnotation = overlay.initialAnnotation else { print("Polyline Configured Incorrectly") continue } - let overlay = polylines[polylineIndex] if !foundTrails.contains(overlay.title!) { self.mapView.addAnnotation(initialAnnotation) @@ -119,9 +126,9 @@ final class MapInterpreter: NSObject { for index in 0..(createAnnotation(title: overlay.title!, latitude: overlay.points()[index].coordinate.latitude, longitude: overlay.points()[index].coordinate.longitude, difficulty: overlay.initialAnnotation!.difficulty!)) - vertex.value.id = overlay.initialAnnotation?.ids![index] - vertex.value.times = overlay.initialAnnotation?.trailTimes![index] - vertex.value.isConnector = overlay.initialAnnotation!.isConnector + vertex.value.id = initialAnnotation.ids![index] + vertex.value.times = initialAnnotation.trailTimes![index] + vertex.value.isConnector = initialAnnotation.isConnector vertices.append(vertex) } } @@ -173,7 +180,7 @@ final class MapInterpreter: NSObject { private func timeWeightCalculation(_ vertex1: Vertex, _ vertex2: Vertex) -> Double { let weightArray = vertex2.value.times! - return weightArray.reduce(0.0, +) / Double(weightArray.count + 1) + return Double(weightArray.reduce(0.0, +) / Double(weightArray.count + 1)) } private func addIntersectingPointsTo(graph: EdgeWeightedDigraph) @@ -231,8 +238,9 @@ final class MapInterpreter: NSObject { guard InteractiveMapViewController.currentUser.alertSettings.contains(report.type) else { continue } NotificationCenter.default.post(name: Notification.Name.Names.createNotification, object: nil, userInfo: ["report": report]) } + self.trailReports = trailReports NotificationCenter.default.post(name: Notification.Name.Names.configureTrailSelector, object: nil) - NotificationCenter.default.post(Notification(name: Notification.Name.Names.updateInitialRegion, userInfo: ["initialRegionLatitude": Double(map.initialLocationLatitude), "initialRegionLongitude": Double(map.initialLocationLongitude), "trailReports": trailReports])) + NotificationCenter.default.post(Notification(name: Notification.Name.Names.updateInitialRegion, userInfo: ["initialRegionLatitude": Double(map.initialLocationLatitude), "initialRegionLongitude": Double(map.initialLocationLongitude)])) }) } diff --git a/TrailblazerIOS/Utils/InteractiveMap.Utils/LocationManagement.Utils.swift b/TrailblazerIOS/Utils/InteractiveMap.Utils/LocationManagement.Utils.swift index a18cb9eb..e956a1ba 100644 --- a/TrailblazerIOS/Utils/InteractiveMap.Utils/LocationManagement.Utils.swift +++ b/TrailblazerIOS/Utils/InteractiveMap.Utils/LocationManagement.Utils.swift @@ -8,6 +8,7 @@ import Foundation import CoreLocation + extension InteractiveMapViewController: CLLocationManagerDelegate { func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { @@ -21,19 +22,18 @@ extension InteractiveMapViewController: CLLocationManagerDelegate guard let currentUserId = Self.currentUser.id else { return } - let radius = 30.0 + let userLocation = locations[0] - var liftWaiting : Vertex? - var timeBegan : Date? - if !isWaitingInLine { - for vertex in self.baseLiftVertexes{ + + if !self.isWaitingInLine { + for vertex in MapInterpreter.shared.baseLiftVertexes{ let liftLocation = CLLocation(latitude: vertex.value.coordinate.latitude, longitude: vertex.value.coordinate.longitude) - if userLocation.distance(from: liftLocation) <= radius + if userLocation.distance(from: liftLocation) <= self.radius { - isWaitingInLine = true - liftWaiting = vertex - timeBegan = Date.now - print("isWaiting in line for lift \(String(describing: liftWaiting?.value.title))") + self.isWaitingInLine = true + self.liftWaiting = vertex + self.timeBegan = Date.now + print("isWaiting in line for lift \(String(describing: self.liftWaiting?.value.title))") break } } @@ -46,24 +46,28 @@ extension InteractiveMapViewController: CLLocationManagerDelegate { print("no longer waiting in line") isWaitingInLine = false - lift.value.times?.append(Date.now.timeIntervalSince(startTime)) liftWaiting = nil timeBegan = nil - guard let id = lift.value.id, let times = lift.value.times else { print("lift does not have id or times"); return } - APIHandler.shared.updatePointTime(point: PointTimeUpdateData(id: id, time: times as! [Float]), completion: { + print(lift.value.times) + print(lift.value.id) + guard let id = lift.value.id, var times = lift.value.times else { print("lift does not have id or times"); return } + times.append(Date.now.timeIntervalSince(startTime)) + APIHandler.shared.updatePointTime(point: PointTimeUpdateData(id: id, time: times), completion: { result in - guard let point = try? result.get() else { - print("test point update Success \(result)") - return + do { + let point = try result.get() + lift.value.times = point.time + print(point) + } catch { + print(error) } - print(point) }) } } if locations[0].distance(from: CLLocation(latitude: self.interactiveMapView.center.x, longitude: self.interactiveMapView.center.y)) <= 7000 { - APIHandler.shared.saveUserLocation(UserLocation(latitude: locations[0].coordinate.latitude, longitude: locations[0].coordinate.longitude, timeReported: "\(locations[0].timestamp)", userID: currentUserId)) +// APIHandler.shared.saveUserLocation(UserLocation(latitude: locations[0].coordinate.latitude, longitude: locations[0].coordinate.longitude, timeReported: "\(locations[0].timestamp)", userID: currentUserId)) } } diff --git a/TrailblazerIOS/Utils/InteractiveMap.Utils/MapDelegate.Utils.swift b/TrailblazerIOS/Utils/InteractiveMap.Utils/MapDelegate.Utils.swift index f1f75f74..53d846df 100644 --- a/TrailblazerIOS/Utils/InteractiveMap.Utils/MapDelegate.Utils.swift +++ b/TrailblazerIOS/Utils/InteractiveMap.Utils/MapDelegate.Utils.swift @@ -61,7 +61,7 @@ extension InteractiveMapViewController: MKMapViewDelegate } if (view.annotation?.title! == nil) { - self.selectedTrailReport = Self.trailReports.first(where: {$0.id == annotation.id}) + self.selectedTrailReport = MapInterpreter.shared.trailReports.first(where: {$0.id == annotation.id}) self.selectedTrailReportAnnotation = annotation self.cancelTrailReportView.isHidden = false return diff --git a/TrailblazerIOS/ViewControllers/AlertPreferencesViewController.swift b/TrailblazerIOS/ViewControllers/AlertPreferencesViewController.swift index 0d2ffbc6..01482542 100644 --- a/TrailblazerIOS/ViewControllers/AlertPreferencesViewController.swift +++ b/TrailblazerIOS/ViewControllers/AlertPreferencesViewController.swift @@ -25,7 +25,7 @@ class AlertPreferencesViewController: UIViewController { } if sender.isOn { InteractiveMapViewController.currentUser.alertSettings.append(type) - for trailReport in InteractiveMapViewController.trailReports.filter({$0.type == type}){ + for trailReport in MapInterpreter.shared.trailReports.filter({$0.type == type}){ NotificationCenter.default.post(name: Notification.Name.Names.createNotification, object: nil, userInfo: ["report": trailReport]) } } diff --git a/TrailblazerIOS/ViewControllers/InteractiveMapViewController.swift b/TrailblazerIOS/ViewControllers/InteractiveMapViewController.swift index c8cfc5cc..efa25ddf 100644 --- a/TrailblazerIOS/ViewControllers/InteractiveMapViewController.swift +++ b/TrailblazerIOS/ViewControllers/InteractiveMapViewController.swift @@ -15,14 +15,12 @@ class InteractiveMapViewController: UIViewController, ErrorHandler { static var currentUser : User = User(username: "Guest", password: "", alertSettings: [], routingPreference: "") - static var mapId: String = { + static var mapId: String { if let str = UserDefaults.standard.value(forKey: "mapId") as? String { return str } return "" - }() - - static var trailReports : [TrailReport] = [] + } var routeInProgress = false @@ -31,9 +29,7 @@ class InteractiveMapViewController: UIViewController, ErrorHandler { var selectedGraph: EdgeWeightedDigraph { return self.isRealTimeGraph ? WebAnalysis.shared.realTimeGraph : self.preferredRoutingGraph } - - var baseLiftVertexes: [Vertex] = [] - + var preferredRoutingGraph : EdgeWeightedDigraph { return self.getPreferredGraph() } @@ -73,6 +69,11 @@ class InteractiveMapViewController: UIViewController, ErrorHandler { var pathCreated: [Vertex] = [] + // Location Management + let radius = 30.0 + var liftWaiting : Vertex? + var timeBegan : Date? + let settingArray = [TrailReportType.moguls.rawValue, TrailReportType.ice.rawValue, TrailReportType.crowded.rawValue, TrailReportType.thinCover.rawValue, TrailReportType.longLiftLine.rawValue, TrailReportType.snowmaking.rawValue, "Cancel"] lazy var trailReportMenu : PopUpMenuFramework = { @@ -207,9 +208,8 @@ class InteractiveMapViewController: UIViewController, ErrorHandler { } @objc func receiveDataFromMapInterpreter(_ sender: NSNotification) { - guard let latitude = sender.userInfo?["initialRegionLatitude"] as? Double, let longitude = sender.userInfo?["initialRegionLongitude"] as? Double, let trailReports = sender.userInfo?["trailReports"] as? [TrailReport] else { return } + guard let latitude = sender.userInfo?["initialRegionLatitude"] as? Double, let longitude = sender.userInfo?["initialRegionLongitude"] as? Double else { return } let initialRegion = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: latitude, longitude: longitude), span: MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.1)) - Self.trailReports = trailReports self.interactiveMapView.setBoundaryAround(region: initialRegion) self.updateSelectedGraphAndShowAllTrails() self.mapLoadingView.isHidden = true diff --git a/TrailblazerIOS/ViewControllers/MapSelectorViewController.swift b/TrailblazerIOS/ViewControllers/MapSelectorViewController.swift index 6699fc48..14a70bdd 100644 --- a/TrailblazerIOS/ViewControllers/MapSelectorViewController.swift +++ b/TrailblazerIOS/ViewControllers/MapSelectorViewController.swift @@ -35,7 +35,6 @@ class MapSelectorViewController : UIViewController, ErrorHandler { } func switchRootViewController(id: String) { - InteractiveMapViewController.mapId = id UserDefaults.standard.set(id, forKey: "mapId") let storyboard = UIStoryboard(name: "Main", bundle: nil) let mainTabBarController = storyboard.instantiateViewController(identifier: "MainTabBarController")