JSPM

adonis-geocoder

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q58813F
  • License MIT

The Adonis Geocoder.

Package Exports

  • adonis-geocoder

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (adonis-geocoder) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Adonis Geocoder

Installation

  1. Add package:
$ npm i adonis-geocoder --save

or

$ yarn add adonis-geocoder
  1. Register providers inside the your bootstrap/app.js file.
const providers = [
  ...
  'adonis-geocoder/providers/GeocoderProvider',
  ...
]
  1. Config

Copy configuration from examples/config.js to config/geocoder.js.

Usage example

const res = await Geocoder.geocode('29 champs elysée paris')

// output :
[ { formattedAddress: '29 Av. des Champs-Élysées, 75008 Paris, France',
    latitude: 48.869384,
    longitude: 2.3071868,
    extra:
     { googlePlaceId: 'ChIJ4e9zicRv5kcRi_EQo6FKduM',
       confidence: 1,
       premise: null,
       subpremise: null,
       neighborhood: 'Paris',
       establishment: null },
    administrativeLevels:
     { level2long: 'Paris',
       level2short: 'Paris',
       level1long: 'Île-de-France',
       level1short: 'Île-de-France' },
    streetNumber: '29',
    streetName: 'Avenue des Champs-Élysées',
    city: 'Paris',
    country: 'France',
    countryCode: 'FR',
    zipcode: '75008',
    provider: 'google' } ]

For more information see node-geocoder.

Credits

Support

Having trouble? Open an issue!

License

The MIT License (MIT). Please see License File for more information.