News for hackers. Stuff that matters.
Re:Google Distance Matrix API for Node.js – Find distance da... by konspence on Saturday April 19, 2014 @06:53PM (#7615062)
This wrapper should grab more than just distance/duration.text (see https://github.com/edwlook/node-google-distance/blob/master/... - I'm assuming Google's API includes the distance as a number, and unit of measurement).

If people want to use this API to convert to a different unit, they have to parse the text which would be very clunky.

Re:Google Distance Matrix API for Node.js – Find distance da... by etcher on Saturday April 19, 2014 @07:00PM (#7615084)
To use different units, you can specify 'imperial' (default) for miles/feet or 'metric' for kilometers/meters.

The wrapper fetches all of the data returned from Google (except for the value fields): http://cl.ly/image/3M003N0s0z3q

It actually might be a good idea to fetch the value fields as well, since that would make conversion to other metrics easier. Thanks for the suggestion.

Re:Google Distance Matrix API for Node.js – Find distance da... by konspence on Sunday April 20, 2014 @10:28PM (#7619441)
I do think it would be valuable to fetch the value field, as then the user can format the text however they want - for example, I may want to say "96 minutes" instead of "1 hour 36 minutes".

Additionally, it's much easier to compare two values (e.g. if one wanted to compare distances between X and Y versus X and Z).

Re:Google Distance Matrix API for Node.js – Find distance da... by etcher on Monday April 21, 2014 @04:28AM (#7620271)
Good point. The value field is fetched as of version 0.2.0.
Re:Google Distance Matrix API for Node.js – Find distance da... by konspence on Tuesday April 22, 2014 @12:13AM (#7625763)
Awesome! That looks nice. Thanks for taking feedback.
Re:Google Distance Matrix API for Node.js – Find distance da... by mck- on Saturday April 19, 2014 @07:22PM (#7615149)
The Google Distance Matrix has a limit of 10x10 locations (25x25 with business license) -- how do you get around that? I don't see any mention of API-key?
Re:Google Distance Matrix API for Node.js – Find distance da... by etcher on Saturday April 19, 2014 @07:48PM (#7615202)
The Google Distance API does not require an API key, but this is something that should be supported for business licenses and per-key quota limit tracking.

Here are the quota limits:

Users of the free API: 100 elements per query. 100 elements per 10 seconds. 2 500 elements per 24 hour period.

Maps for Business customers: 625 elements per query. 1 000 elements per 10 seconds. 100 000 elements per 24 hour period.

Read more: https://developers.google.com/maps/documentation/distancemat...