Hierarchy
Hierarchy data exposes the clients, campuses, buildings and floors that a ViewerToken
has access to.
Getting a hierarchy
Hierarchy data can be loaded directly without the need for a viewer via locatrix.plans.loadHierarchy()
.
locatrix.plans.loadHierarchy(viewerToken)
viewerToken
: <string>- Returns: <Promise<Hierarchy>>
Returns a promise that will resolve with the hierarchy data.
The promise will reject if there are network errors while loading the hierarchy.
Format
Hierarchy data is returned in the following format.
{
clients: [{
...
campuses: [{
...
buildings: [{
...
floors: [{
...
}]
}]
}]
}]
}
Client
code
: <string>name
: <string>campuses
: <Campus[]>
Campus
code
: <string>name
: <string>planCode
: <string> | <null>address
: <string> | <null>postCode
: <string> | <null>buildings
: <Building[]>
planCode
will be null if the ViewerToken
does not have access to the site plan.
address
and postCode
will be null if the fields have never been set.
Building
code
: <string>name
: <string>address
: <string> | <null>postCode
: <string> | <null>floors
: <Floor[]>
Floor
planCode
will be null if the ViewerToken
does not have access to the floor plan.
address
and postCode
will be null if the fields have never been set.