Resource
public enum Resource: Decodable
A specific Campus Navigator resource, e.g. a room, a building’s lecture halls, etc. This primarily maps to anything the webapp can display in a specific view.
-
A coordinate on the map, e.g. https://navigator.tu-dresden.de/@13.732,51.02839999999999,15.z
Declaration
Swift
case coordinate(coord: CLLocationCoordinate2D, zoom: Int)
-
A specific region on the map, e.g. https://navigator.tu-dresden.de/karten/dresden/geb/apb
Declaration
Swift
case map(region: String, building: String)
-
A route, e.g. https://navigator.tu-dresden.de/routing/APB/WEB/foot,shortest/@13.741269714355468,51.02893981618553,15.z
Declaration
Swift
case route(origin: String, destination: String, mode: Route.Mode) // Include the coordinate info in the params here?
-
A specific building, e.g. https://navigator.tu-dresden.de/gebaeude/apb
Declaration
Swift
case building(building: String)
-
A specific building’s accessibility information, e.g. https://navigator.tu-dresden.de/barrierefrei/biz
Declaration
Swift
case buildingAccessibility(building: String)
-
A specific building’s lecture hall listing, e.g. https://navigator.tu-dresden.de/hoersaele/apb
Declaration
Swift
case lectureHalls(building: String)
-
A specific floor, e.g. https://navigator.tu-dresden.de/etplan/apb/00
Declaration
Swift
case floor(building: String, floor: String)
-
A single room highlighted on a specific floor, e.g. https://navigator.tu-dresden.de/etplan/biz/02/raum/062102.0020
Declaration
Swift
case roomOnFloor(building: String, floor: String, room: String)
-
A specific room, e.g. https://navigator.tu-dresden.de/raum/542100.2310
Declaration
Swift
case room(room: String)
-
Create a Resource from a given Campus Navigator URL.
Throws
Error.resourceURL with the URL if unable to parseWarning
This only accepts valid CN URLs, not the search output. See here.Declaration
Swift
public init(withURL url: URL) throws
Parameters
url
url
-
Warning
This only accepts search results, not actual CN URLs.Declaration
Swift
public init(from decoder: Decoder) throws
-
This resource’s building ID, if any.
Declaration
Swift
public var buildingID: String?
-
The canonical user-accessible URL pointing to this resource.
Declaration
Swift
public var url: URL?
-
Declaration
Swift
public static func ==(lhs: Resource, rhs: Resource) -> Bool
Parameters
lhs
rhs