Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents and stores all data known about the map

Hierarchy

  • MapData

Index

Constructors

Private constructor

  • new MapData(vertexStringToId: Map<string, number>, graph: Graph<number, Vertex>, rooms: Map<string, default>, floors: Floor[], edges: Edge[], bounds: LatLngBounds): MapData
  • Parameters

    • vertexStringToId: Map<string, number>
    • graph: Graph<number, Vertex>
    • rooms: Map<string, default>
    • floors: Floor[]
    • edges: Edge[]
    • bounds: LatLngBounds

    Returns MapData

Methods

createDevLayerGroup

  • Create a layer with vertices, edges, and clock location popup for one floor

    Parameters

    • floor: string

      Floor to create the dev layer for

    Returns Result<LSomeLayerWithFloor, string>

createLayerGroupsFromPath

  • Create layer groups displaying a path, one for each floor of a building

    Parameters

    • path: number[]

      The path to create a group for

    Returns Result<Set<LSomeLayerWithFloor>, string>

Private definitionDijkstra

  • definitionDijkstra(src: GeocoderDefinition): [Map<number, number>, Map<number, null | number>, number][]
  • Run Dijkstra's algorithm on all exits from a definition

    Parameters

    Returns [Map<number, number>, Map<number, null | number>, number][]

    Results of running on each exit and the exit vertex IDs. See also Graph.dijkstra

Private entranceVertexIds

  • Get the IDs of the entrance vertices of a definition

    Parameters

    Returns number[]

findBestPath

  • Find the best path from src to dest

    Parameters

    Returns Option<number[]>

    Path from src to dest with the lowest total weight, if any exists, as an array of vertex IDs

findBestPathLength

  • Find the length of the best path from src to dest

    Parameters

    Returns Option<number>

    Total weight of the lowest weight path, if such a path exists

getAllFloors

  • getAllFloors(): Floor[]
  • Returns Floor[]

getAllRooms

  • Returns default[]

getBounds

  • getBounds(): LatLngBounds
  • Get the bounds of the map

    Returns LatLngBounds

Private getClosestVertex

  • Finds the closest vertex to location on the same floor as location

    Parameters

    Returns number

    ID of the closest vertex

getGraph

  • Get the map's navigation graph

    Returns Graph<number, Vertex>

getRoom

  • getRoom(roomNumber: string): Option<default>
  • Get the room with the specified room number if it exists

    Parameters

    • roomNumber: string

    Returns Option<default>

Static Private createVertexNameMapping

  • createVertexNameMapping(jsonVertices: JsonVertices): Map<string, number>
  • Creates a map from vertex names to integer IDs

    Parameters

    • jsonVertices: JsonVertices

      Vertices to create the mapping for

    Returns Map<string, number>

Static Private navigationGraph

  • navigationGraph(jsonVertices: JsonVertices, jsonEdges: JsonEdge[], vertexNameToId: Map<string, number>): Result<Graph<number, Vertex>, string>
  • Create the navigation graph for a map

    Parameters

    • jsonVertices: JsonVertices

      JSON vertex data

    • jsonEdges: JsonEdge[]

      JSON edge data

    • vertexNameToId: Map<string, number>

      Mapping from vertex string names to integer IDs

    Returns Result<Graph<number, Vertex>, string>

    Navigation graph for the map

Static Private navigationGraphEdges

  • navigationGraphEdges(jsonEdges: JsonEdge[], vertexNameToId: Map<string, number>, vertices: Map<number, Vertex>): Result<[number, number, number, boolean][], string>
  • Parameters

    • jsonEdges: JsonEdge[]
    • vertexNameToId: Map<string, number>
    • vertices: Map<number, Vertex>

    Returns Result<[number, number, number, boolean][], string>

Static Private navigationGraphVertices

  • navigationGraphVertices(jsonVertices: JsonVertices, vertexNameToId: Map<string, number>): Result<Map<number, Vertex>, string>
  • Parameters

    • jsonVertices: JsonVertices
    • vertexNameToId: Map<string, number>

    Returns Result<Map<number, Vertex>, string>

Static new

  • new(mapData: JsonMap, bounds: LatLngBounds): Result<MapData, string>
  • Parameters

    • mapData: JsonMap
    • bounds: LatLngBounds

    Returns Result<MapData, string>

Static Private roomNumberMapping

  • roomNumberMapping(jsonNumbersRooms: JsonRooms, vertexNameMapping: Map<string, number>, navigationGraph: Graph<number, Vertex>): Result<Map<string, default>, string>
  • Create the mapping from room numbers to Rooms

    Parameters

    • jsonNumbersRooms: JsonRooms

      JSON room data

    • vertexNameMapping: Map<string, number>

      Mapping from vertex string names to integer IDs

    • navigationGraph: Graph<number, Vertex>

      Navigation graph for map

    Returns Result<Map<string, default>, string>

    Mapping from room numbers to Rooms

Static Private vertexColor

  • vertexColor(vertex: Vertex): string
  • Get the color to use when rendering a vertex

    Parameters

    Returns string

    Hex color code, eg. "#0000ff" for blue

Generated using TypeDoc