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.
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:
For isochrones based on time, the "value" for the range is always in seconds and the "area" is always in km^2
For isochrones based on distance, the "value" for the range is always in metres and the "area" is in the units specified, e.g. (mi -> mi^2, m -> m^2, km -> km^2)
The fix for the second part will be based on the understanding above.
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.