photon-geocoder
v1.0.1
Published
Methods to query photon.komoot.io API
Downloads
261
Maintainers
Readme
photon-geocoder
A simple wrapper for Photon API by komoot. Search for a place or perform a reverse lookup.
This is an unofficial client, not affiliated with komoot in any way.
Installation
Using npm:
npm i photon-geocoder
Using yarn:
yarn add photon-geocoder
Table of contents
Interfaces
Functions
Functions
asSimpleArray
▸ asSimpleArray(featureCollection
): Feature
<Point
>[]
A helper function to extract data from the FeatureCollection result
export
Parameters
| Name | Type | Description |
| :------------------ | :---------------------------- | :----------------------------------------- |
| featureCollection
| FeatureCollection
<Point
> | The FeatureCollection to extract data from |
Returns
Feature
<Point
>[]
reverseGeocode
▸ reverseGeocode(lat
, lon
): Promise
<FeatureCollection
<Point
>>
Geocodes a latitude, longitude
export
Parameters
| Name | Type | Description |
| :---- | :------- | :---------- |
| lat
| number
| Latitude |
| lon
| number
| Longitude |
Returns
Promise
<FeatureCollection
<Point
>>
The geocoded Point FeatureCollection
search
▸ search(searchTerm
, options?
): Promise
<FeatureCollection
<Point
>>
Searches for a place
export
Parameters
| Name | Type | Description |
| :----------- | :--------------------------------------------- | :---------------------- |
| searchTerm
| string
| Search term to look for |
| options?
| SearchOptions
| - |
Returns
Promise
<FeatureCollection
<Point
>>
The FeatureCollection with the results