Comments (2)
Hi,
could you please provide your code example.
Because on my side this is working very well with different options offered by the OpenCage Geocoder API for the reverse geocoding:
const opencage = require('opencage-api-client');
opencage
.geocode({ q: '45.188529,5.724524', no_annotations: 1 })
.then((data) => {
console.log('reverse geocode -------------------------');
console.log(data);
})
.catch((error) => {
console.log('error', error.message);
});
opencage
.geocode({ q: '+45.188529,+5.724524', no_annotations: 1 })
.then((data) => {
console.log('reverse geocode -------------------------');
console.log(data);
})
.catch((error) => {
console.log('error', error.message);
});
opencage
.geocode({ q: '45.188529 5.724524', no_annotations: 1 })
.then((data) => {
console.log('reverse geocode -------------------------');
console.log(data);
})
.catch((error) => {
console.log('error', error.message);
});
this code outputs :
reverse geocode -------------------------
{
documentation: 'https://opencagedata.com/api',
licenses: [
{
name: 'see attribution guide',
url: 'https://opencagedata.com/credits'
}
],
rate: { limit: 2500, remaining: 2491, reset: 1600300800 },
results: [
{
components: [Object],
confidence: 10,
formatted: '11 bis Place Victor Hugo, 38000 Grenoble, France',
geometry: [Object]
}
],
status: { code: 200, message: 'OK' },
stay_informed: {
blog: 'https://blog.opencagedata.com',
twitter: 'https://twitter.com/OpenCage'
},
thanks: 'For using an OpenCage API',
timestamp: {
created_http: 'Wed, 16 Sep 2020 08:58:08 GMT',
created_unix: 1600246688
},
total_results: 1
}
reverse geocode -------------------------
{
documentation: 'https://opencagedata.com/api',
licenses: [
{
name: 'see attribution guide',
url: 'https://opencagedata.com/credits'
}
],
rate: { limit: 2500, remaining: 2491, reset: 1600300800 },
results: [
{
components: [Object],
confidence: 10,
formatted: '11 bis Place Victor Hugo, 38000 Grenoble, France',
geometry: [Object]
}
],
status: { code: 200, message: 'OK' },
stay_informed: {
blog: 'https://blog.opencagedata.com',
twitter: 'https://twitter.com/OpenCage'
},
thanks: 'For using an OpenCage API',
timestamp: {
created_http: 'Wed, 16 Sep 2020 08:58:08 GMT',
created_unix: 1600246688
},
total_results: 1
}
reverse geocode -------------------------
{
documentation: 'https://opencagedata.com/api',
licenses: [
{
name: 'see attribution guide',
url: 'https://opencagedata.com/credits'
}
],
rate: { limit: 2500, remaining: 2490, reset: 1600300800 },
results: [
{
components: [Object],
confidence: 10,
formatted: '11 bis Place Victor Hugo, 38000 Grenoble, France',
geometry: [Object]
}
],
status: { code: 200, message: 'OK' },
stay_informed: {
blog: 'https://blog.opencagedata.com',
twitter: 'https://twitter.com/OpenCage'
},
thanks: 'For using an OpenCage API',
timestamp: {
created_http: 'Wed, 16 Sep 2020 08:58:08 GMT',
created_unix: 1600246688
},
total_results: 1
}```
from opencage-api-client.
Code examples above have been added into the repo with PR #40
Without any news from @johuder33, I close this issue for now.
Please let me know if you need help with anything else.
from opencage-api-client.
Related Issues (20)
- Dependency Dashboard
- Improve tests on the fetch wrapper
- prevent error in browser when api key is not set
- update CI tests around fetch HOT 1
- Is axios could be a better solution than fetch-everywhere + es6-promise for polyfill ? HOT 5
- [Feature Request] Add support for custom language HOT 1
- Add new parameter address_only
- drop any fetch dependencies HOT 1
- add User-Agent header HOT 1
- Opencage options ex. Proximity HOT 5
- Implement AbortController/AbortSignal pattern HOT 1
- upgrade deps HOT 1
- new unit tests with API test keys HOT 1
- refactor geocode function HOT 1
- TypeScript support (type definitions) HOT 6
- TypeScript GeocodeOption is undefined HOT 1
- document samples
- update README.md HOT 1
- improve unit tests HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencage-api-client.