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.services.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 |
LatLngLiteral
|
string
|
<optional> |
Can either be a coordinate `{lat: number, lng: number}` or a string in the format "type:id" e.g. "venue:586ca9f1bc1f5702406442b6" | |
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> |
The lr parameter is deprecated. Instead, use the static function setLanguage on the MapsIndoors class. See the documentation: https://app.mapsindoors.com/mapsindoors/js/sdk/latest/docs/mapsindoors.MapsIndoors.html#.setLanguage for more information. | |
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.services.LocationsService.getLocations({q: 'S102'}).then(locations => { ... });
Events
# update_completed
This event will fire when MapsIndoors data has been synchronized from the backend.
Example
mapsindoors.services.LocationsService.addListener('update_completed', () => {...})