https://github.com/stephangeorg/georcoder-deprecated
https://github.com/stephangeorg/georcoder-deprecated
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/stephangeorg/georcoder-deprecated
- Owner: StephanGeorg
- Created: 2016-02-18T13:24:51.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-25T14:23:55.000Z (almost 9 years ago)
- Last Synced: 2025-01-11T08:51:25.359Z (over 1 year ago)
- Language: JavaScript
- Size: 1.72 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Georcoder
A promises based geocoder for node.js
## Installation
Installing using npm (node package manager):
npm i georcoder
## Usage ##
### Initialization ###
```javascript
var Georcoder = require('georcoder'),
geocoder = new GeocoderArcGIS({
client_id: 'YOUR CLIENT ID',
client_secret: 'YOUR CLIENT SECRET'
});
```
The constructor function also takes an optional configuration object:
### Geocode ###
```javascript
geocoder.geocode('Berlin',{})
.then(function(response){
console.log(response);
})
.catch(function(error){
console.log(error);
});
```
Optional parameters:
### Reverse ###
```javascript
geocoder.positionToWords({
position: '51.484463,-0.195405'
}).then(function(response) {
console.log(response); //prom.cape.pump
});
```
Optional parameters:
### Suggest ###
```javascript
geocoder.suggest('Glogauer Straße, Berlin',{})
.then(function(response){
console.log(response);
})
.catch(function(error){
console.log(error);
});
```
Optional parameters:
### Response ###
All the methods return a promise.
## License