コード例 #1
0
        public ActionResult Heatmap()
        {
            ViewModels.HeatMapModel heatMapModel      = new ViewModels.HeatMapModel();
            List <PointsOfInterest> pointsOfInterests = PointsOfInterestCache.GetPointsOfInterestBag();

            heatMapModel.PoliceStations   = pointsOfInterests.Where(x => x.Type == "Police Station").ToList();
            heatMapModel.FireStations     = pointsOfInterests.Where(x => x.Type == "Fire Station").ToList();
            heatMapModel.Libraries        = pointsOfInterests.Where(x => x.Type == "Library").ToList();
            heatMapModel.CommunityCenters = pointsOfInterests.Where(x => x.Type == "Community Center").ToList();
            return(View(heatMapModel));
        }
コード例 #2
0
        public ActionResult Quadrants(string quadrant)
        {
            ViewModels.QuadrantModel quadrantModel = new ViewModels.QuadrantModel();

            quadrantModel.Events            = EventCache.GetEventBag().Where(x => x.Quadrant == quadrant).ToList();
            quadrantModel.PointsOfInterests = PointsOfInterestCache.GetPointsOfInterestBag()
                                              .Where(x => x.Location == quadrant).ToList();

            switch (quadrant)
            {
            case "NW":
                quadrantModel.Lat        = "51.0750527";
                quadrantModel.Lng        = "-114.1194289";
                quadrantModel.Quadrant   = "NW";
                quadrantModel.Population = 330000L;
                ;
                break;

            case "NE":

                quadrantModel.Lat        = "51.0865101";
                quadrantModel.Lng        = "-113.967823";
                quadrantModel.Quadrant   = "NE";
                quadrantModel.Population = 265000L;
                break;

            case "SW":
                quadrantModel.Lat        = "51.0213185";
                quadrantModel.Lng        = "-114.1023589";
                quadrantModel.Quadrant   = "SW";
                quadrantModel.Population = 280000L;

                break;

            case "SE":
                quadrantModel.Lat        = "51.011528";
                quadrantModel.Lng        = "-113.9891212";
                quadrantModel.Quadrant   = "SE";
                quadrantModel.Population = 355000L;
                break;

            default:
                break;
            }
            return(View(quadrantModel));
        }
コード例 #3
0
        public ActionResult Analytics()
        {
            var pointsOfInterests = PointsOfInterestCache.GetPointsOfInterestBag().ToList();

            return(View(pointsOfInterests));
        }