Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enniel/adonis-geocoder
https://github.com/enniel/adonis-geocoder
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/enniel/adonis-geocoder
- Owner: enniel
- License: mit
- Created: 2017-06-21T08:59:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-04T07:16:33.000Z (over 7 years ago)
- Last Synced: 2024-12-06T09:45:55.836Z (about 1 month ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Adonis Geocoder
## Installation
1. Add package:
```bash
$ npm i adonis-geocoder --save
```
or```bash
$ yarn add adonis-geocoder
```2. Register providers inside the your bootstrap/app.js file.
```js
const providers = [
...
'adonis-geocoder/providers/GeocoderProvider',
...
]
```3. Config
Copy configuration from [examples/config.js](https://github.com/enniel/adonis-geocoder/blob/master/examples/examples.js) to `config/geocoder.js`.
## Usage example
```js
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](https://github.com/nchaulet/node-geocoder).
## Credits
- [Evgeni Razumov](https://github.com/enniel)
## Support
Having trouble? [Open an issue](https://github.com/enniel/adonis-geocoder/issues/new)!
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.