here-geocoder
v1.0.1
Published
Client for HERE REST API.
Downloads
172
Readme
HERE Node client (using promises)
Simple client for HERE geocoding searches. Supports
search.json
geocode.json
Usage
See the tests for up-to-date usage examples.
Geocoding
import Here from 'here-geocoder'
const here = new Here({
appId: 'YOUR-APP-ID-STRING',
appCode: 'YOUR-APP-CODE-STRING'
})
export async function myGeoFunction () {
const result = await here.geocode('some search string', {
mapview: '49.0049,-123.3085;49.3946,-122.0812',
maxresults: 20
// any other attributes here.
})
}
Autocomplete
// import and initialize the same as above
export async function myGeoFunction () {
const result = await here.suggest('123 Apricot ln', {
mapview: '49.0049,-123.3085;49.3946,-122.0812',
maxresults: 20
// any other attributes here.
})
}
See https://developer.here.com/documentation/geocoder/topics/resource-geocode.html for other possible attributes to pass into the second parameter.
Development
The project uses yarn
, npm
should work too, but it will add a package-lock.json
file which you may not want to commit.
yarn install
yarn run test
# OR
yarn run test:watch
Contributors
- Noah Gray gitlab github - initial release and developer - [email protected]