Repository navigation
Expand file tree
/
Copy pathConvertJSONArray
More file actions
50 lines (46 loc) · 1.67 KB
/
Copy pathConvertJSONArray
File metadata and controls
50 lines (46 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
"destination_addresses" : [
"No. 45, Corporation Complex, Naicker New Street, Madurai, Tamil Nadu 625001, India"
],
"origin_addresses" : [ "11A, 5th St, Lakshmipuram, Madurai, Tamil Nadu 625005, India" ],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "1.7 km",
"value" : 1657
},
"duration" : {
"text" : "8 mins",
"value" : 488
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}
// //let qryy='http://18.213.86.227:4000/courier/couriercompany'
// let qryy='https://maps.googleapis.com/maps/api/distancematrix/json?origins=9.919900,%2078.125770&destinations=9.923954,78.117355&mode=driving&language=en-EN&sensor=false&key=key'
// Request.get(qryy,(err,res)=>{
// let ret=JSON.parse(res.body)
// console.log(ret)
// //console.log(ret.rows[0].elements)
// console.log(ret.rows[0].elements[0].distance)
// console.log(ret.rows[0].elements[0].distance.value)
// // var people = Object.keys(ret);
// // people.forEach(function(person) {
// // var items = Object.keys(ret[person]);
// // items.forEach(function(item) {
// // var value = ret[person][item];
// // console.log(person+': '+item+' = '+value);
// // });
// // });
// // var tot = Object.keys(ret).length
// // console.log('Tot='+tot)
// // Object.keys(ret.rows).forEach(function(k){
// // console.log(k + ' - ' + ret[k]);
// // });
// });