public ApiModule(ICountDownService countDownService) { Get["/api/bustops/{code}"] = parameters => { var bustop = new Bustop(parameters.code); return(bustop.GetBustopDetails(countDownService)); }; Get["/api/bustops/latitude/{latitude}/longitude/{longitude}"] = _ => { var location = new Location(_.Latitude, _.Longitude); return(location.GetMarkers(countDownService)); }; }
public LocationModel GetMarkers(ICountDownService countDownService) { var locationModel = countDownService.GetMarkers(SwLat, SwLng, NeLat, NeLng); foreach (var marker in locationModel.Markers) { marker.Delta = Math.Abs(_latitude - marker.Lat) + Math.Abs(_longitude - marker.Lng); } locationModel.Markers = locationModel.Markers.OrderBy(m => m.Delta); return(locationModel); }
public BustopModel GetBustopDetails(ICountDownService service) { return(service.GetBustopDetails(_code)); }
public ChristmasCountDownWorker(ICountDownService countDownService) { _countDownService = countDownService; }
public IndexModule(ICountDownService countDownService) { Get["/"] = parameters => View["index"]; Get["/nearbystops"] = parameters => View["nearbystops"]; Get["/stopcode/{stopcode}"] = _ => View["stopcode", _.stopcode]; }
public LightShowCountdownWorker(ICountDownService countDownService) { _countDownService = countDownService; }