// ================================================== // ITopoTrailInfo public static HtmlString GetJson(ITopoTrailInfo trail) { if (trail == null || trail.Tracks.Count() == 0) { new HtmlString("[]"); } return(new HtmlString(GetTrailJson(trail).ToString())); }
private static JArray GetTrailJson(ITopoTrailInfo trail) { JArray list = new JArray(); foreach (var track in trail.Tracks) { dynamic t = new JObject(); //t.id = track.ID; t.track = track.Name; t.points = new JArray(); foreach (var point in track.TopoPoints) { dynamic p = new JObject(); p.lat = point.Latitude; p.lng = point.Longitude; t.points.Add(p); } list.Add(t); } return(list); }
public static string GetModifyUrl(ITopoTrailInfo trail, MergeConfirmTypes confirm) { return($"/trail/modify/{trail.Key}/?confirm={confirm}"); }
public static string GetModifyUrl(ITopoTrailInfo trail) { return($"/trail/modify/{trail.Key}/"); }
public static string GetUpdateUrl(ITopoTrailInfo trail) { return($"/trail/update/{trail.Key}/"); }
public static string GetTrailUrl(ITopoTrailInfo trail) { return(GetTrailUrl(trail.Key)); }
public static string GetRenderUrl(ITopoTrailInfo trail) { return($"/trail/render/{trail.Key}/"); }
public static string GetElevationUrl(ITopoTrailInfo trail) { return($"/trail/elevation/{trail.Key}/"); }
public static TopoStats FromTrail(ITopoTrailInfo trail) { return(FromTracks(trail.Tracks)); }