tomayac / local-reverse-geocoder

Local reverse geocoder for Node.js based on GeoNames data
Apache License 2.0
190 stars 58 forks source link

Cannot read properties of undefined (reading 'length') #52

Closed cedricdelpoux closed 2 years ago

cedricdelpoux commented 2 years ago

Following the readme, I tried a simple:

geocoder.init({},
      function () {
        var point = {latitude: 42.083333, longitude: 3.1}
        geocoder.lookUp(point, function (err, res) {
          console.log(JSON.stringify(res, null, 2))
        })
      }
    )

But get an error Cannot read properties of undefined (reading 'length').

The errors occurs at this line.

tomayac commented 2 years ago

Thanks for the report, fixed in https://github.com/tomayac/local-reverse-geocoder/commit/0e3e04ecf380134ede0bb80368d1ab32995d3ef0.