adonis-geocoder
v1.0.0
Published
The Adonis Geocoder.
Downloads
26
Maintainers
Readme
Adonis Geocoder
Installation
- Add package:
$ npm i adonis-geocoder --save
or
$ yarn add adonis-geocoder
- Register providers inside the your bootstrap/app.js file.
const providers = [
...
'adonis-geocoder/providers/GeocoderProvider',
...
]
- 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.