Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format not parsed correctly #13

Open
nickdos opened this issue Jan 21, 2016 · 2 comments
Open

Format not parsed correctly #13

nickdos opened this issue Jan 21, 2016 · 2 comments

Comments

@nickdos
Copy link

nickdos commented Jan 21, 2016

I have an example user input that does not return the expected DD output:

input coordinates: 36.01S,146.95E - this is recognised by Google geocoding API.

var parts = address.split(",");
var lat = magellan(parts[0]).latitude().toDD();
var lng = magellan(parts[1]).longitude().toDD();
console.log("magellan", parts, lat, lng);

console output:

magellan ["36.01S", "146.95E"] -3.100167 14.115833`

the following does work correctly:

magellan ["-36.01", "146.95"] -36.010000 146.950000
magellan ["36°1'S", "146°57'E"] -36.016667 146.950000
@nickdos
Copy link
Author

nickdos commented Jan 21, 2016

Fixed with change to line 18:

var DD_FORMAT_REGEX = /^([+-]?\d{1,3})(.\d+)?\s*[NSEW]?$/;

@mechalas
Copy link

mechalas commented Mar 8, 2017

That should be line 15 on the current source (as of 3/8/17). But yes, this does fix tihngs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants