示例#1
0
        private PartialViewResult ViewEditProjectBoundingBox(Project project, EditProjectBoundingBoxViewModel viewModel)
        {
            var layerGeoJsons = new List <LayerGeoJson>
            {
                project.HasProjectLocationPoint
                        ? new LayerGeoJson("Simple Location", project.SimpleLocationToGeoJsonFeatureCollection(true),
                                           FirmaHelpers.DefaultColorRange[1], 0.8m, LayerInitialVisibility.Show)
                        : null,
                project.HasProjectLocationDetail
                        ? new LayerGeoJson("Detailed Location", project.AllDetailedLocationsToGeoJsonFeatureCollection(),
                                           FirmaHelpers.DefaultColorRange[1], 0.8m, LayerInitialVisibility.Show)
                        : null
            }
            .Where(x => x != null)
            .ToList();

            layerGeoJsons.Add(PriorityLandscape.GetPriorityLandscapeWmsLayerGeoJson("#90C3D4", 0.1m, LayerInitialVisibility.Hide));
            layerGeoJsons.Add(DNRUplandRegion.GetRegionWmsLayerGeoJson("#90C3D4", 0.1m, LayerInitialVisibility.Hide));
            var boundingBox = BoundingBox.MakeBoundingBoxFromProject(project);
            var mapInitJson = new MapInitJson("EditProjectBoundingBoxMap", 10, layerGeoJsons, boundingBox)
            {
                AllowFullScreen = false,
                DisablePopups   = true
            };
            var editProjectBoundingBoxUrl =
                SitkaRoute <ProjectLocationController> .BuildUrlFromExpression(c => c.EditProjectBoundingBox(project));

            var viewData = new EditProjectBoundingBoxViewData(mapInitJson, editProjectBoundingBoxUrl, EditProjectBoundingBoxFormID);

            return(RazorPartialView <EditProjectBoundingBox, EditProjectBoundingBoxViewData, EditProjectBoundingBoxViewModel>(viewData, viewModel));
        }
        public ViewResult Index()
        {
            var layerGeoJsons = new List <LayerGeoJson>();

            layerGeoJsons = new List <LayerGeoJson>
            {
                PriorityLandscape.GetPriorityLandscapeWmsLayerGeoJson("#59ACFF", 0.2m, LayerInitialVisibility.Show)
            };

            var mapInitJson = new MapInitJson("priorityLandscapeIndex", 10, layerGeoJsons, BoundingBox.MakeNewDefaultBoundingBox());
            var firmaPage   = FirmaPage.GetFirmaPageByPageType(FirmaPageType.PriorityLandscapesList);
            var viewData    = new IndexViewData(CurrentPerson, mapInitJson, firmaPage);

            return(RazorView <Index, IndexViewData>(viewData));
        }