here-geocoder

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i here-geocoder

Weekly Downloads

51

Version

1.0.1

License

All rights reserved

Unpacked Size

123 kB

Total Files

10

Last publish

Collaborators

  • noah-kun