traffordDataLab / leaflet.reachability

Plugin for the Leaflet JavaScript library to show areas of reachability based on time or distance for different modes of travel using the openrouteservice isochrones API.
MIT License
65 stars 7 forks source link

v1.0.0 Area for isochrones returns NaN #4

Closed itsozz closed 5 years ago

itsozz commented 5 years ago

This is a 2-stage issue. Firstly, the reason for the NaN is an incorrectly referenced key "total_area_km" which doesn't exist in the response from the API, it should be "area".

Secondly, the units for the "area" output have been changed by the API to match those of the input type, rather than simply defaulting to km^2. See openrouteservice issue #91 for more background. This means that the units conversion code needs to be reworked to match the output from the API. My understanding is that the output from the API is as follows:

The fix for the second part will be based on the understanding above.

itsozz commented 5 years ago

Fixed in release v1.0.1