コード例 #1
0
 static void Main(string[] args)
 {
     var atApi = new ApiToAT.ApiToAT(ApiKey, ApiUrl);
     string busStopId = "0001";
     var routes = atApi.GetRoutesFromId(busStopId);
     routes = atApi.AddShapesToRoute(routes);
     routes = atApi.GetAllShapesCoordinatesFromShapeId(routes);
     routes.ToArray();
 }
コード例 #2
0
        public ProgramMain()
        {
            var atApi = new ApiToAT.ApiToAT(ApiKey, ApiUrl);
            JsonSettings.MaxJsonLength = int.MaxValue;
            Get["/busStopCode={busStopCode}"] = parameters =>
            {
                string busStopCode = parameters.busStopCode.ToString();
                var busStop = new BusStop(busStopCode);
                busStop = atApi.GetStopIdFromStopCode(busStop);
                if (busStop.StopId.Length == 0)
                {
                    return "";
                }
                IEnumerable<Route> routes = atApi.GetRoutesFromId(busStop.StopId);
                routes = atApi.AddShapesToRoute(routes);
                routes = atApi.GetAllShapesCoordinatesFromShapeId(routes);
                busStop.Routes = routes;
                return Response.AsJson(busStop);
            };

            Get["/"] = parameters => "Home Page";
        }