public HttpResponseMessage Get(string from, string to, int radius, string types) { WayPoint fromWp = GoogleController.GetAddress(from); WayPoint toWp = GoogleController.GetAddress(to); List <Place> waypoints = RouteController.CreateNiceRoute(fromWp, toWp, radius, types.Split(',').ToList()); var resp = new HttpResponseMessage() { Content = new StringContent(JsonConvert.SerializeObject(waypoints)) }; resp.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); return(resp); }
public HttpResponseMessage Get(string from, string to, int radius, string types) { string [] spl = from.Split(','); WayPoint fromWp = new WayPoint(Double.Parse(spl[0], CultureInfo.InvariantCulture), Double.Parse(spl[1], CultureInfo.InvariantCulture)); spl = to.Split(','); WayPoint toWp = new WayPoint(Double.Parse(spl[0], CultureInfo.InvariantCulture), Double.Parse(spl[1], CultureInfo.InvariantCulture)); List <Place> waypoints = RouteController.CreateNiceRoute(fromWp, toWp, radius, types.Split(',').ToList()); var resp = new HttpResponseMessage() { Content = new StringContent(JsonConvert.SerializeObject(waypoints)) }; resp.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); return(resp); }