/** * */ //for geometry api var completeRouteResponse,hotspots,pos1; //for the cards var map,infowindow1,pos,infoWindow; //to display multiple cards var resp=JSON.parse(localStorage.getItem("response")); r(); function r(){ for (var i = resp.routes.length-1; i >=0 ; i--) { document.getElementById('cd'+i).innerHTML=`
Distance :`+resp.routes[i].legs[0].distance.text+`
Duration :`+resp.routes[i].legs[0].duration.text+`
No. of Hotspots :
Fare :`+resp.routes[i].fare.text+`
`; $('#tft'+i).append(txt); } //check for summary if(resp.routes[0].summary){ var txt=`Description :`+resp.routes[i].summary+`
`; $('#rd'+i).append(txt); } } /* first for loop ends here */ } /* r() function ends here */