public async Task<IEnumerable<LatLng>> FindDirections(LatLng start, LatLng end, string mode) { var mc = new GMapDirection (); rootObject = mc.GetDistaceRoute(start, end, "driving"); var leg = mc.GetLeg(rootObject); GeoStartAddress = leg!=null? leg.start_address:""; GeoEndAddress = leg != null ? leg.end_address : ""; var duration = mc.GetGeoDuration(leg); var distance = mc.GetGeoDistance(leg); var pointsList = mc.GetGeoRouteDirectionsPoints (rootObject); return pointsList; }
public async Task<IEnumerable<LatLng>> FindDirectionsByAddress(string start, string end, string mode) { var mc = new GMapDirection (); rootObject = mc.GetRouteByAddress(start, end, "driving"); var leg = mc.GetLeg(rootObject); GeoStartAddress = leg!=null? leg.start_address:""; GeoEndAddress = leg != null ? leg.end_address : ""; var duration = mc.GetGeoDuration(leg); var distance = mc.GetGeoDistance(leg); Duration = string.Format ("{0} Time: {1} Mins ", distance.value, duration.value); _startLocation = new LatLng (leg.start_location.lat, leg.start_location.lng); _endLocation = new LatLng (leg.end_location.lat, leg.end_location.lng); var pointsList = mc.GetGeoRouteDirectionsPoints (rootObject); return pointsList; }