Methods
# async static getLocation(id) → {Promise.<Location>}
Get a location by it's id
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Id of the location |
Promise.<Location>
Example
mapsindoors.LocationsService.getLocation('5666f75bc1843a08b81bef72').then(location => { ... });
# async static getLocations(argsopt) → {Promise.<Array.<Location>>}
Search for locations
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
args |
Object |
<optional> |
The query parameters | |
q |
string |
<optional> |
Use a text query to search for one or more locations. | |
fields |
string |
<optional> |
Fields to search in when using the search string parameter 'q'. Empty/default: "name,description,aliases,categories" | |
types |
Array.<string> |
<optional> |
Filter by types in a comma separated list e.g. office,kitchen,etc. A location only has one type. | |
categories |
Array.<string> |
<optional> |
Filter by categories in a comma separated list e.g. meeting_room,office,etc. A location can be in multiple categories. | |
bbox |
Object |
<optional> |
Limits the result to inside the boundingbox. `{east: number, north: number, south: number, west: number}` | |
bbox.east |
number | Max longitude of the bounds in degrees. | ||
bbox.north |
number | Max latitude of the bounds in degrees. | ||
bbox.south |
number | Min latitude of the bounds in degrees. | ||
bbox.west |
number | Min longitude of the bounds in degrees. | ||
take |
number |
<optional> |
Max number of locations to get | |
skip |
number |
<optional> |
Skip the first number of entries | |
near |
Object | string |
<optional> |
Can either be a coordinate `{lat: number, lng: number}` or a string in the format "type:id" e.g. "venue:586ca9f1bc1f5702406442b6" | |
near.lat |
number | Latitude in degrees. | ||
near.lng |
number | Longitude in degrees. | ||
radius |
number |
<optional> |
A radius in meters. When using near with a point a radius must be supplied to limit the search to within that radius from the point. | |
includeOutsidePOI |
boolean |
<optional> |
false | When set to true all POIs that are outside buildings will be included in the result regartles of floor level specifiend in the path. |
orderBy |
string |
<optional> |
Which property the result should be sorted by. | |
sortOrder |
string |
<optional> |
ASC | Specifies in which order the results is sorted either "ASC" or "DESC" |
lr |
string |
<optional> |
Sets the preferred language that the result should be returned in. | |
building |
string |
<optional> |
Limit the search for locations to a building | |
venue |
string |
<optional> |
Limit the search for locations to a venue (id or name) | |
floor |
string |
<optional> |
Filter locations to a floor |
- Retuns an array of locations.
Promise.<Array.<Location>>
Example
mapsindoors.LocationsService.getLocations({q: 'S102', lr: 'en' }).then(locations => { ... });