km and miles wrong way round?
-
Hi,
While testing this for possible use on a client site, the units (km and miles) returns results the wrong way round.
I set the divider to 1 and the price also to 1 so the calculated shipping cost effectively tells us the distance.
When I set the units to kilometers it shows cost/distance in miles.
When I set the units to miles it shows cost/distance in km.I can see in the code that it looks to be correct:
if($units == 'ml') { 102: $setUnits = '&units=imperial'; 103 } else { 104: $setUnits = '&units=metric'; 105 }
But looking into the Google distance matrix API docs it states that the units variable only affects the text displayed not the actual distance which is always calculated in meters (metric).
https://developers.google.com/maps/documentation/distance-matrix/intro#unit_systemsDo you know of a way around this issue to get the distance calculated or converted to the chosen unit?
- The topic ‘km and miles wrong way round?’ is closed to new replies.