1.0.1 • Published 3 years ago

photon-geocoder v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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

NameTypeDescription
featureCollectionFeatureCollection<Point>The FeatureCollection to extract data from

Returns

Feature<Point>[]


reverseGeocode

reverseGeocode(lat, lon): Promise<FeatureCollection<Point>>

Geocodes a latitude, longitude

export

Parameters

NameTypeDescription
latnumberLatitude
lonnumberLongitude

Returns

Promise<FeatureCollection<Point>>

The geocoded Point FeatureCollection


search

search(searchTerm, options?): Promise<FeatureCollection<Point>>

Searches for a place

export

Parameters

NameTypeDescription
searchTermstringSearch term to look for
options?SearchOptions-

Returns

Promise<FeatureCollection<Point>>

The FeatureCollection with the results