springmeyer / arc.js

great circle routes in javascript
http://springmeyer.github.io/arc.js/
BSD 2-Clause "Simplified" License
369 stars 70 forks source link

NaN error when start and end co-ordinates are the same #29

Closed pjlee11 closed 5 years ago

pjlee11 commented 8 years ago

Hi,

My name is Phil Lee, I'm a student at Brighton University studying Digital Games Production. My final year project is based on geolocation data visualisations. Your API is awesome just wanted to inform you of an error I have found.

I have noticed that if any of the start and end co-ordinates in a data set are exactly the same then 'leaflet-src.js' throws the error 'Uncaught Error: Invalid LatLng object: (NaN, NaN)'. I'm assuming this hasn't been noticed as most geolocation data sets do not have start and end co-ordinates that are exactly the same. For my use case I'll will strip out all the duplicates but it is a shame to see the whole data set fail on an uncaught error, especially with a data set of 30,000+. I would be interested to hear if you take any action on this.

Regards, Phil Lee pjlee1112@hotmail.co.uk or pl79@uni.brighton.ac.uk Trainee Web Developer BBC News Student at University Brighton

tmcw commented 8 years ago

Indeed, this should be one of the cases where arc.js throws a specific error.