Api Utils
LazarilloUtils
Useful class for fetching info from the Lazarillo server that use Typescript code
Kind: global class
- LazarilloUtils
- .fetchFromUrl(resourceUrl, params, options) ⇒
- .fetchPlaceInfo(apiKey, placeId) ⇒
- .fetchSubplaces(apiKey, targetPlace) ⇒
- .fetchNearbyPlaces(apiKey, latitude, longitude) ⇒
- .fetchRoute(apiKey, travelMode, fromLat, fromLng, toLat, toLng, withMobility, announceFormat, userBearing, fromFloor, fromBuilding, toFloor, toBuilding, lang, unitSystem) ⇒
- .fetchParentPlaces(apikey) ⇒
LazarilloUtils.fetchFromUrl(resourceUrl, params, options) ⇒
Kind: static method of LazarilloUtils
Returns:
A promise of the response
| Param | Description |
|---|---|
| resourceUrl | Path to the endpoint |
| params | this should have the token included |
| options | options for the fetch method, like the GET or POST |
LazarilloUtils.fetchPlaceInfo(apiKey, placeId) ⇒
Return info about the place
Kind: static method of LazarilloUtils
Returns:
A promise of the response
| Param |
|---|
| apiKey |
| placeId |
LazarilloUtils.fetchSubplaces(apiKey, targetPlace) ⇒
Return all the subplace sof the parent place
Kind: static method of LazarilloUtils
Returns:
A promise of the response
| Param |
|---|
| apiKey |
| targetPlace |
LazarilloUtils.fetchNearbyPlaces(apiKey, latitude, longitude) ⇒
Return places of interest that are nearby to the passed latitude and longitude
Kind: static method of LazarilloUtils
Returns:
A promise of the response
| Param |
|---|
| apiKey |
| latitude |
| longitude |
LazarilloUtils.fetchRoute(apiKey, travelMode, fromLat, fromLng, toLat, toLng, withMobility, announceFormat, userBearing, fromFloor, fromBuilding, toFloor, toBuilding, lang, unitSystem) ⇒
Return a route from the backend in json format
Kind: static method of LazarilloUtils
Returns:
A promise of the response
| Param | Default | Description |
|---|---|---|
| apiKey | Api key |
|
| travelMode | One of the following options: BICYCLING, DRIVING, TRANSIT, WALKING. Default WALKING |
|
| fromLat | Latitude of origin place |
|
| fromLng | Longitude of origin place |
|
| toLat | Latitude of destination place |
|
| toLng | Longitude of destination place |
|
| withMobility | 1 |
0 or 1. 0 Means a walking route and 1 a wheel chair route. Default 0 |
| announceFormat | One of the following options: RELATIVE, CARDINAL, CLOCK. Default RELATIVE |
|
| userBearing | Bearing of the user phone. Default 0 |
|
| fromFloor | If indoor route, floor of origin point |
|
| fromBuilding | If indoor route, building of origin point |
|
| toFloor | If indoor, floor of destination point |
|
| toBuilding | If indoor, building of destination point |
|
| lang | en |
Language of the instructions |
| unitSystem | METERS |
One of the following options: METRIC, IMPERIAL, STEPS. Default METRIC |
LazarilloUtils.fetchParentPlaces(apikey) ⇒
Returns the parent places available for a specific api key
Kind: static method of LazarilloUtils
Returns:
A promise of the response
| Param | Description |
|---|---|
| apikey | Api key |