Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions lib/addressFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function run({coordinates=[], addresses=[]}=args={}, cb) {

//Iterate over array of addresses, asyncronously calling Google's API
//for each address to determine it's lat/lng coordinates
async.each(addresses, (address, eachNext) => {
async.eachSeries(addresses, (address, eachNext) => {

googleMapsClient.geocode({address}, (err, response) => {

Expand All @@ -54,12 +54,6 @@ function run({coordinates=[], addresses=[]}=args={}, cb) {
eachNext();
});
}, (err) => {

//Because we're asyncronously calling Google's API, return order can't be
//guaranteed. As a result, let's sort the array just so it always comes out
//the same way
withinRegionArr.sort();

return cb(err, withinRegionArr);
});
}
Expand Down