nchaulet / node-geocoder

nodejs geocoding library
http://nchaulet.github.io/node-geocoder/
MIT License
926 stars 213 forks source link

change from openstreetmaps to HERE but it doesn't work #353

Closed moses19850 closed 5 months ago

moses19850 commented 6 months ago

Hi, my plan is to switch from openstreetmaps to HERE. As I'm a beginner, can you please help me to get it done properly? I have already an API key from HERE. The test example gives me an error. Therefore I ask for help. Even with the description it's impossible for me to get it work.

Thanks in advance

This is my current code:

`var NodeGeocoder = require('node-geocoder');

var options = { provider: 'openstreetmap', httpAdapter: 'https', // Default apiKey: ' ', // for Mapquest, OpenCage, Google Premier formatter: 'json' // 'gpx', 'string', ... };

var geocoder = NodeGeocoder(options);

geocoder.reverse({lat:xx.xxxxxx, lon:xx.xxxxxx}, function(err, res) { console.log(res); console.log(res[0].city); console.log(res[0].state); console.log(res[0].zipcode); console.log(res[0].streetName); console.log(res[0].streetNumber); });`

moses19850 commented 5 months ago

I use nodejs-geolocation which works perfectly with here