Skip to content

Commit

Permalink
addition to elevationHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
captainAnderman committed Mar 13, 2012
1 parent c1f3743 commit e52ba3c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions geolib.js
Expand Up @@ -654,7 +654,7 @@
};
var elevationService = new google.maps.ElevationService();
elevationService.getElevationAlongPath(positionalRequest,function (results, status){
geolib.elevationHandler(results,status,cb);
geolib.elevationHandler(results, status, coords, keys, cb);
});
},

Expand All @@ -676,17 +676,19 @@
geolib.useDecimal(coords[i][longitude]));
}
gm.elevationFromPath(path.join('|'), path.length, function(err, results) {
geolib.elevationHandler(results.results, results.status, cb)
geolib.elevationHandler(results.results, results.status, coords, keys, cb)
});
},

elevationHandler: function(results, status, cb){
elevationHandler: function(results, status, coords, keys, cb){
var latsLngsElevs = [];
var latitude = keys.latitude;
var longitude = keys.longitude;
if (status == "OK" ) {
for (var i = 0; i < results.length; i++) {
latsLngsElevs.push({
"lat":results[i].location.lat,
"lng":results[i].location.lng,
"lat":coords[i][latitude],
"lng":coords[i][longitude],
"elev":results[i].elevation
});
}
Expand Down

0 comments on commit e52ba3c

Please sign in to comment.