java - How to calculate total directions in multiple markers eclipse -


i need total distance in multiple directions, when run show current distance. shown in image, when click third marker calculate second direction (it should first , second). thank :)

enter image description here

enter image description here

            // fetching i-th route             list<hashmap<string, string>> path = result.get(i);              // fetching points in i-th route             for(int j=0;j<path.size();j++){                 hashmap<string,string> point = path.get(j);                  if(j==0){    // distance list                     distance = (string)point.get("distance");                     continue;                 }else if(j==1){ // duration list                     duration = (string)point.get("duration");                     continue;                 }                  double lat = double.parsedouble(point.get("lat"));                 double lng = double.parsedouble(point.get("lng"));                 latlng position = new latlng(lat, lng);                  points.add(position);             }              // adding points in route lineoptions             lineoptions.addall(points);             lineoptions.width(3);         }     tvdistanceduration.settext(" distance :"+distance + ", duration:"+duration); 


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -