dijs / wiki

Wikipedia Interface for Node.js
MIT License
315 stars 61 forks source link

Error with coordinates() when zeros after decimal point #126

Open antitim opened 4 years ago

antitim commented 4 years ago

Hi, thanks for this library. An error occurs while retrieving page coordinates 'KAAD-LP'.

wiki().page('KAAD-LP')
    .then(page => page.coordinates())
    .then(console.log);

Probably a problem with the coordinate format: 37/58/57.00|N|120|22|43.00|W

There are zeros after the decimal point

dijs commented 4 years ago

Unfortunately I did not write the coordinates parser, another contributor did and I have not been able to get a hold of them. So I am not an expert in this section of the codebase.

Can you provide some source/examples of what this should return?

Maybe I can clean this up for you.