private static LayerGeoJson GetMatchMakerAreaOfInterestGeoJson(Organization organization) { LayerGeoJson layer = null; // organization boundary layer if (organization.UseOrganizationBoundaryForMatchmaker && organization.OrganizationBoundary != null) { var organizationBoundaryToFeatureCollection = organization.OrganizationBoundaryToFeatureCollection(); organizationBoundaryToFeatureCollection.Features.ForEach(x => x.Properties.Add("Hover Name", FieldDefinitionEnum.AreaOfInterest.ToType().GetFieldDefinitionLabel())); layer = new LayerGeoJson("Organization Boundary", organizationBoundaryToFeatureCollection, ProjectFirmaModels.Models.Organization.OrganizationAreaOfInterestMapLayerColor, 1, LayerInitialVisibility.LayerInitialVisibilityEnum.Show); } // custom areas of interest if (!organization.UseOrganizationBoundaryForMatchmaker && organization.MatchMakerAreaOfInterestLocations.Any()) { var areaOfInterestLayerGeoJsonFeatureCollection = DbGeometryToGeoJsonHelper.FeatureCollectionFromDbGeometry(organization.MatchMakerAreaOfInterestLocations.Select(x => x.MatchMakerAreaOfInterestLocationGeometry), "Area Of Interest", "User Set"); areaOfInterestLayerGeoJsonFeatureCollection.Features.ForEach(x => x.Properties.Add("Hover Name", FieldDefinitionEnum.AreaOfInterest.ToType().GetFieldDefinitionLabel())); layer = new LayerGeoJson($"{FieldDefinitionEnum.Organization.ToType().GetFieldDefinitionLabel()} {FieldDefinitionEnum.AreaOfInterest.ToType().GetFieldDefinitionLabel()} Geometries", areaOfInterestLayerGeoJsonFeatureCollection, ProjectFirmaModels.Models.Organization.OrganizationAreaOfInterestMapLayerColor, 1, LayerInitialVisibility.LayerInitialVisibilityEnum.Show); } return(layer); }
public SearchMapInitJson(string mapDivID, LayerGeoJson searchableLayerGeoJson) : base(mapDivID, DefaultZoomLevel, MapInitJsonHelpers.GetJurisdictionMapLayers().ToList(), BoundingBox.MakeNewDefaultBoundingBox()) { SearchableLayerGeoJson = searchableLayerGeoJson; JurisdictionLayerGeoJson = Layers.Single(x => x.LayerName == MapInitJsonHelpers.CountyCityLayerName); }
public ViewResult Detail(OnlandVisualTrashAssessmentAreaPrimaryKey onlandVisualTrashAssessmentAreaPrimaryKey) { var onlandVisualTrashAssessmentArea = onlandVisualTrashAssessmentAreaPrimaryKey.EntityObject; var geoJsonFeatureCollection = new List <OnlandVisualTrashAssessmentArea> { onlandVisualTrashAssessmentArea } .ToGeoJsonFeatureCollection(); var observationsLayerGeoJson = onlandVisualTrashAssessmentArea.GetTransectBackingAssessment()?.OnlandVisualTrashAssessmentObservations.MakeObservationsLayerGeoJson(); var assessmentAreaLayerGeoJson = new LayerGeoJson("assessmentArea", geoJsonFeatureCollection, "#ffff00", .5m, LayerInitialVisibility.Show); var transectLineLayerGeoJson = onlandVisualTrashAssessmentArea.GetTransectLineLayerGeoJson(); var mapInitJson = new OVTAAreaMapInitJson("ovtaAreaMap", assessmentAreaLayerGeoJson, transectLineLayerGeoJson, observationsLayerGeoJson); var newUrl = SitkaRoute <OnlandVisualTrashAssessmentAreaController> .BuildUrlFromExpression(x => x.NewAssessment(onlandVisualTrashAssessmentArea)); var editDetailsUrl = SitkaRoute <OnlandVisualTrashAssessmentAreaController> .BuildUrlFromExpression(x => x.EditBasics(onlandVisualTrashAssessmentArea)); var confirmEditLocationUrl = SitkaRoute <OnlandVisualTrashAssessmentAreaController> .BuildUrlFromExpression(x => x.ConfirmEditLocation(onlandVisualTrashAssessmentArea)); var viewData = new Views.OnlandVisualTrashAssessmentArea.DetailViewData(CurrentPerson, onlandVisualTrashAssessmentArea, mapInitJson, newUrl, editDetailsUrl, confirmEditLocationUrl); return(RazorView <Views.OnlandVisualTrashAssessmentArea.Detail, Views.OnlandVisualTrashAssessmentArea.DetailViewData>(viewData)); }
public ViewResult Organization(OrganizationPrimaryKey organizationPrimaryKey) { var organization = organizationPrimaryKey.EntityObject; var organizationHasOptedIn = organization.MatchmakerOptIn ?? false; var projectFinderGridSpec = new ProjectFinderGridSpec(CurrentFirmaSession); var projectMatchmakerScoresForOrganization = organizationHasOptedIn ? new ProjectOrganizationMatchmaker().GetPartnerOrganizationMatchMakerScoresForParticularOrganization(CurrentFirmaSession, organization) : new List <PartnerOrganizationMatchMakerScore>(); var projectsToShow = projectMatchmakerScoresForOrganization.Select(x => x.Project).Where(x => x.ProjectStage.ShouldIncludeInMatchmaker()).ToList(); var filterValues = ResultsController.GetDefaultFilterValuesForFilterType(ProjectMapCustomization.DefaultLocationFilterType.ToEnum, true); var initialCustomization = new ProjectMapCustomization(ProjectMapCustomization.DefaultLocationFilterType, filterValues, ProjectColorByType.ProjectStage); var projectLocationsLayerGeoJson = new LayerGeoJson($"{FieldDefinitionEnum.ProjectLocation.ToType().GetFieldDefinitionLabel()}", projectsToShow.MappedPointsToGeoJsonFeatureCollection(false, true, true), "blue", 1, LayerInitialVisibility.LayerInitialVisibilityEnum.Show); var projectLocationsMapInitJson = new ProjectLocationsMapInitJson(projectLocationsLayerGeoJson, initialCustomization, "ProjectLocationsMap", false); // Add Organization Type boundaries according to configuration projectLocationsMapInitJson.Layers.AddRange(HttpRequestStorage.DatabaseEntities.Organizations.GetConfiguredBoundaryLayersGeoJson()); var profileCompletionDictionary = organization.GetMatchmakerOrganizationProfileCompletionDictionary(); DisplayMatchMakerToastMessagesIfAny(organization, projectMatchmakerScoresForOrganization, profileCompletionDictionary, organizationHasOptedIn); var matchMakerAreaOfInterestGeoJson = GetMatchMakerAreaOfInterestGeoJson(organization); var viewData = new ProjectFinderOrganizationViewData(CurrentFirmaSession, organization, projectMatchmakerScoresForOrganization, projectFinderGridSpec, projectLocationsMapInitJson, matchMakerAreaOfInterestGeoJson); return(RazorView <ProjectFinderOrganization, ProjectFinderOrganizationViewData>(viewData)); }
public DelineationMapInitJson(string mapDivID, IEnumerable <Models.TreatmentBMP> databaseEntitiesTreatmentBMPs, BoundingBox boundingBox) : base(mapDivID, DefaultZoomLevel, MapInitJsonHelpers.GetJurisdictionMapLayers().ToList(), boundingBox) { TreatmentBMPLayerGeoJson = MakeTreatmentBMPLayerGeoJson(databaseEntitiesTreatmentBMPs, (feature, treatmentBMP) => { feature.Properties.Add("TreatmentBMPType", treatmentBMP.TreatmentBMPType.TreatmentBMPTypeName); if (treatmentBMP.UpstreamBMPID != null) { feature.Properties.Add("UpstreamBMPID", treatmentBMP.UpstreamBMPID); feature.Properties.Add("UpstreamBMPName", treatmentBMP.UpstreamBMP.TreatmentBMPName); } if (treatmentBMP.Delineation != null) { feature.Properties.Add("DelineationURL", treatmentBMP.GetDelineationUrl()); if (treatmentBMP.Delineation != null) { feature.Properties.Add("DelineationID", treatmentBMP.Delineation.DelineationID); feature.Properties.Add("IsDelineationVerified", treatmentBMP.Delineation.IsVerified); } feature.Properties.Add("DelineationType", treatmentBMP.Delineation?.DelineationType.DelineationTypeDisplayName); } }, false); }
public ViewResult Detail(TaxonomyBranchPrimaryKey taxonomyBranchPrimaryKey) { var taxonomyBranch = taxonomyBranchPrimaryKey.EntityObject; var taxonomyBranchProjects = taxonomyBranch.GetAssociatedProjects(CurrentPerson).ToList(); var projectMapCustomization = new ProjectMapCustomization(ProjectLocationFilterType.TaxonomyBranch, new List <int> { taxonomyBranch.TaxonomyBranchID }, ProjectColorByType.ProjectStage); var projectLocationsLayerGeoJson = new LayerGeoJson($"{FieldDefinition.ProjectLocation.GetFieldDefinitionLabel()}", Project.MappedPointsToGeoJsonFeatureCollection(taxonomyBranchProjects, true, true), "red", 1, LayerInitialVisibility.Show); var projectLocationsMapInitJson = new ProjectLocationsMapInitJson(projectLocationsLayerGeoJson, projectMapCustomization, "TaxonomyBranchProjectMap"); var projectLocationsMapViewData = new ProjectLocationsMapViewData(projectLocationsMapInitJson.MapDivID, ProjectColorByType.ProjectStage.DisplayName, MultiTenantHelpers.GetTopLevelTaxonomyTiers(), CurrentPerson.CanViewProposals); var associatePerformanceMeasureTaxonomyLevel = MultiTenantHelpers.GetAssociatePerformanceMeasureTaxonomyLevel(); var canHaveAssociatedPerformanceMeasures = associatePerformanceMeasureTaxonomyLevel == TaxonomyLevel.Branch; var taxonomyTierPerformanceMeasures = taxonomyBranch.GetTaxonomyTierPerformanceMeasures(); var relatedPerformanceMeasuresViewData = new RelatedPerformanceMeasuresViewData(associatePerformanceMeasureTaxonomyLevel, true, taxonomyTierPerformanceMeasures, canHaveAssociatedPerformanceMeasures); List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas = null; if (canHaveAssociatedPerformanceMeasures) { performanceMeasureChartViewDatas = taxonomyTierPerformanceMeasures.Select(x => new PerformanceMeasureChartViewData(x.Key, CurrentPerson, false, new List <Project>())).ToList(); } var taxonomyLevel = MultiTenantHelpers.GetTaxonomyLevel(); var viewData = new DetailViewData(CurrentPerson, taxonomyBranch, projectLocationsMapInitJson, projectLocationsMapViewData, canHaveAssociatedPerformanceMeasures, relatedPerformanceMeasuresViewData, performanceMeasureChartViewDatas, taxonomyLevel); return(RazorView <Summary, DetailViewData>(viewData)); }
public ViewResult Index() { var firmaPageTypeHomePage = FirmaPageType.ToType(FirmaPageTypeEnum.HomePage); var firmaPageByPageTypeHomePage = FirmaPage.GetFirmaPageByPageType(firmaPageTypeHomePage); var firmaPageTypeHomePageAdditionalInfo = FirmaPageType.ToType(FirmaPageTypeEnum.HomeAdditionalInfo); var firmaPageByPageTypeHomePageAdditionalInfo = FirmaPage.GetFirmaPageByPageType(firmaPageTypeHomePageAdditionalInfo); var firmaPageTypeHomePageMapInfo = FirmaPageType.ToType(FirmaPageTypeEnum.HomeMapInfo); var firmaPageByPageTypeHomePageMapInfo = FirmaPage.GetFirmaPageByPageType(firmaPageTypeHomePageMapInfo); var firmaHomePageImages = HttpRequestStorage.DatabaseEntities.FirmaHomePageImages.ToList().OrderBy(x => x.SortOrder).ToList(); var currentPersonCanViewProposals = CurrentPerson.CanViewProposals; var projectsToShow = ProjectMapCustomization.ProjectsForMap(CurrentPerson); var projectMapCustomization = ProjectMapCustomization.CreateDefaultCustomization(projectsToShow, currentPersonCanViewProposals); var projectLocationsLayerGeoJson = new LayerGeoJson($"{FieldDefinition.ProjectLocation.GetFieldDefinitionLabelPluralized()}", Project.MappedPointsToGeoJsonFeatureCollection(projectsToShow, false, true), "red", 1, LayerInitialVisibility.Show); var projectLocationsMapInitJson = new ProjectLocationsMapInitJson(projectLocationsLayerGeoJson, projectMapCustomization, "ProjectLocationsMap") { AllowFullScreen = false, Layers = HttpRequestStorage.DatabaseEntities.Organizations.GetBoundaryLayerGeoJson().Where(x => x.LayerInitialVisibility == LayerInitialVisibility.Show).ToList() }; var projectLocationsMapViewData = new ProjectLocationsMapViewData(projectLocationsMapInitJson.MapDivID, ProjectColorByType.ProjectStage.DisplayName, MultiTenantHelpers.GetTopLevelTaxonomyTiers(), currentPersonCanViewProposals); var featuredProjectsViewData = new FeaturedProjectsViewData(HttpRequestStorage.DatabaseEntities.Projects.Where(x => x.IsFeatured).ToList().GetActiveProjectsVisibleToUser(CurrentPerson)); var viewData = new IndexViewData(CurrentPerson, firmaPageByPageTypeHomePage, firmaPageByPageTypeHomePageAdditionalInfo, firmaPageByPageTypeHomePageMapInfo, featuredProjectsViewData, projectLocationsMapViewData, projectLocationsMapInitJson, firmaHomePageImages); return(RazorView <Index, IndexViewData>(viewData)); }
private PartialViewResult ViewEditProjectLocationDetailed(Project project, ProjectLocationDetailViewModel viewModel) { var mapDivID = $"project_{project.GetEntityID()}_EditDetailedMap"; var detailedLocationGeoJsonFeatureCollection = project.DetailedLocationToGeoJsonFeatureCollection(true); var editableLayerGeoJson = new LayerGeoJson($"{FieldDefinitionEnum.ProjectLocation.ToType().GetFieldDefinitionLabel()} Detail", detailedLocationGeoJsonFeatureCollection, "red", 1, LayerInitialVisibility.LayerInitialVisibilityEnum.Show); var layers = MapInitJson.GetConfiguredGeospatialAreaMapLayers(); var userCanViewPrivateLocations = CurrentFirmaSession.UserCanViewPrivateLocations(project); layers.AddRange(MapInitJson.GetProjectLocationSimpleMapLayer(project, userCanViewPrivateLocations)); var boundingBox = ProjectLocationSummaryMapInitJson.GetProjectBoundingBox(project, userCanViewPrivateLocations); var mapInitJson = new MapInitJson(mapDivID, 10, layers, MapInitJson.GetExternalMapLayers(), boundingBox) { AllowFullScreen = false, DisablePopups = true }; var mapFormID = GenerateEditProjectLocationFormID(project.GetEntityID()); var uploadGisFileUrl = SitkaRoute <ProjectLocationController> .BuildUrlFromExpression(c => c.ImportGdbFile(project.GetEntityID())); var saveFeatureCollectionUrl = SitkaRoute <ProjectLocationController> .BuildUrlFromExpression(x => x.EditProjectLocationDetailed(project.GetEntityID(), null)); var hasSimpleLocationPoint = project.HasProjectLocationPoint(userCanViewPrivateLocations); var viewData = new ProjectLocationDetailViewData(project.GetEntityID(), mapInitJson, editableLayerGeoJson, uploadGisFileUrl, mapFormID, saveFeatureCollectionUrl, ProjectLocation.FieldLengths.Annotation, hasSimpleLocationPoint, project.LocationIsPrivate); return(RazorPartialView <ProjectLocationDetail, ProjectLocationDetailViewData, ProjectLocationDetailViewModel>(viewData, viewModel)); }
public DetailViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.GeospatialArea geospatialArea, MapInitJson mapInitJson, LayerGeoJson projectLocationsLayerGeoJson, ViewGoogleChartViewData viewGoogleChartViewData, List <ProjectFirmaModels.Models.PerformanceMeasure> performanceMeasures, List <ProjectCustomGridConfiguration> projectCustomDefaultGridConfigurations) : base(currentFirmaSession) { GeospatialArea = geospatialArea; MapInitJson = mapInitJson; ProjectLocationsLayerGeoJson = projectLocationsLayerGeoJson; ViewGoogleChartViewData = viewGoogleChartViewData; PageTitle = geospatialArea.GeospatialAreaName; GeospatialAreaTypeName = geospatialArea.GeospatialAreaType.GeospatialAreaTypeName; GeospatialAreaTypeNamePluralized = geospatialArea.GeospatialAreaType.GeospatialAreaTypeNamePluralized; EntityName = $"{GeospatialAreaTypeName}"; UserHasGeospatialAreaManagePermissions = new GeospatialAreaManageFeature().HasPermissionByFirmaSession(currentFirmaSession); IndexUrl = SitkaRoute <GeospatialAreaController> .BuildUrlFromExpression(x => x.Index(geospatialArea.GeospatialAreaType)); var projectDetails = HttpRequestStorage.DatabaseEntities.vProjectDetails.ToDictionary(x => x.ProjectID); ProjectCustomDefaultGridSpec = new ProjectCustomGridSpec(currentFirmaSession, projectCustomDefaultGridConfigurations, ProjectCustomGridType.Default.ToEnum, projectDetails, currentFirmaSession.Tenant) { ObjectNameSingular = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}", ObjectNamePlural = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true }; ProjectCustomDefaultGridName = "geospatialAreaProjectListGrid"; ProjectCustomDefaultGridDataUrl = SitkaRoute <ProjectCustomGridController> .BuildUrlFromExpression(tc => tc.GeospatialAreaProjectsGridJsonData(geospatialArea)); PerformanceMeasureChartViewDatas = performanceMeasures.Select(x => geospatialArea.GetPerformanceMeasureChartViewData(x, currentFirmaSession)).ToList(); GeospatialAreaDescriptionViewPageContentViewData = new ViewPageContentViewData(geospatialArea, currentFirmaSession); }
private PartialViewResult ViewEditProjectLocationDetailed(Project project, ProjectLocationDetailViewModel viewModel) { var mapDivID = $"project_{project.EntityID}_EditDetailedMap"; var detailedLocationGeoJsonFeatureCollection = project.ProjectLocations.Where(pl => !pl.ArcGisObjectID.HasValue).ToGeoJsonFeatureCollection(); var editableLayerGeoJson = new LayerGeoJson($"{FieldDefinition.ProjectLocation.GetFieldDefinitionLabel()} Detail", detailedLocationGeoJsonFeatureCollection, "red", 1, LayerInitialVisibility.Show); var arcGisLocationGeoJsonFeatureCollection = project.ProjectLocations.Where(pl => pl.ArcGisObjectID.HasValue).ToGeoJsonFeatureCollection(); var arcGisLayerGeoJson = new LayerGeoJson($"{FieldDefinition.ProjectLocation.GetFieldDefinitionLabel()} Detail", arcGisLocationGeoJsonFeatureCollection, "red", 1, LayerInitialVisibility.Show); var layers = MapInitJson.GetAllGeospatialAreaMapLayers(LayerInitialVisibility.Show); layers.AddRange(MapInitJson.GetProjectLocationSimpleMapLayer(project)); var boundingBox = ProjectLocationSummaryMapInitJson.GetProjectBoundingBox(project); var mapInitJson = new MapInitJson(mapDivID, 10, layers, boundingBox) { AllowFullScreen = false, DisablePopups = true }; var mapFormID = GenerateEditProjectLocationFormID(project.EntityID); var uploadGisFileUrl = SitkaRoute <ProjectLocationController> .BuildUrlFromExpression(c => c.ImportGdbFile(project.EntityID)); var saveFeatureCollectionUrl = SitkaRoute <ProjectLocationController> .BuildUrlFromExpression(x => x.EditProjectLocationDetailed(project.EntityID, null)); var hasSimpleLocationPoint = project.ProjectLocationPoint != null; var viewData = new ProjectLocationDetailViewData(project.EntityID, mapInitJson, editableLayerGeoJson, arcGisLayerGeoJson, uploadGisFileUrl, mapFormID, saveFeatureCollectionUrl, ProjectLocation.FieldLengths.ProjectLocationNotes, hasSimpleLocationPoint); return(RazorPartialView <ProjectLocationDetail, ProjectLocationDetailViewData, ProjectLocationDetailViewModel>(viewData, viewModel)); }
public TrashModuleMapInitJson(string mapDivID, LayerGeoJson treatmentBMPLayerGeoJson, LayerGeoJson parcelLayerGeoJson, BoundingBox boundingBox, List <LayerGeoJson> layerGeoJsons) : base(mapDivID, DefaultZoomLevel, layerGeoJsons, boundingBox) { TreatmentBMPLayerGeoJson = treatmentBMPLayerGeoJson; ParcelLayerGeoJson = parcelLayerGeoJson; }
public ProjectLocationsMapInitJson(LayerGeoJson projectLocationsLayerGeoJson, ProjectMapCustomization customization, string mapDivID, bool isFullProjectMap) : base(mapDivID, DefaultZoomLevel, isFullProjectMap? GetAllGeospatialAreaMapLayersForFullProjectMap() : GetConfiguredGeospatialAreaMapLayers(), isFullProjectMap ? GetExternalMapLayersForFullProjectMap() : GetExternalMapLayers(), BoundingBox.MakeNewDefaultBoundingBox()) { ProjectMapCustomization = customization; ProjectLocationsLayerGeoJson = projectLocationsLayerGeoJson; }
public OVTASummaryMapInitJson(string mapDivID, LayerGeoJson observationsLayerGeoJson, LayerGeoJson assessmentAreaLayerGeoJson, LayerGeoJson transectLineLayerGeoJson) : base(mapDivID, DefaultZoomLevel, MapInitJsonHelpers.GetJurisdictionMapLayers().ToList(), BoundingBox.MakeBoundingBoxFromLayerGeoJsonList(new List <LayerGeoJson> { assessmentAreaLayerGeoJson })) { AssessmentAreaLayerGeoJson = assessmentAreaLayerGeoJson; TransectLineLayerGeoJson = transectLineLayerGeoJson; ObservationsLayerGeoJson = observationsLayerGeoJson; }
public ProjectLocationDetailViewDataForAngular(MapInitJson mapInitJson, LayerGeoJson editableLayerGeoJson, LayerGeoJson arcGisLayerGeoJson, int annotationMaxLength) { MapInitJson = mapInitJson; EditableLayerGeoJson = editableLayerGeoJson; ArcGisLayerGeoJson = arcGisLayerGeoJson; AnnotationMaxLength = annotationMaxLength; GeospatialAreaMapServiceLayerNames = FirmaWebConfiguration.GetWmsLayerNames(); ProjectLocationTypeJsons = ProjectLocationType.GetAllProjectLocationTypeJsons(); }
public ViewResult Detail() { var tenant = HttpRequestStorage.Tenant; var tenantAttribute = MultiTenantHelpers.GetTenantAttributeFromCache(); var editBasicsUrl = new SitkaRoute <TenantController>(c => c.EditBasics()).BuildUrlFromExpression(); var editBoundingBoxUrl = new SitkaRoute <TenantController>(c => c.EditBoundingBox()).BuildUrlFromExpression(); var editClassificationSystemsUrl = new SitkaRoute <TenantController>(c => c.EditClassificationSystems()).BuildUrlFromExpression(); var editStylesheetUrl = new SitkaRoute <TenantController>(c => c.EditStylesheet()).BuildUrlFromExpression(); var editTenantLogoUrl = new SitkaRoute <TenantController>(c => c.EditTenantLogo()).BuildUrlFromExpression(); var deleteTenantStyleSheetFileResourceUrl = new SitkaRoute <TenantController>(c => c.DeleteTenantStyleSheetFileResource()).BuildUrlFromExpression(); var deleteTenantSquareLogoFileResourceUrl = new SitkaRoute <TenantController>(c => c.DeleteTenantSquareLogoFileResource()).BuildUrlFromExpression(); var deleteTenantBannerLogoFileResourceUrl = new SitkaRoute <TenantController>(c => c.DeleteTenantBannerLogoFileResource()).BuildUrlFromExpression(); var boundingBoxLayer = new LayerGeoJson("Bounding Box", new FeatureCollection(new List <TenantAttribute> { tenantAttribute }.Select(x => DbGeometryToGeoJsonHelper.FromDbGeometry(x.DefaultBoundingBox)).ToList()), FirmaHelpers.DefaultColorRange[0], 0.8m, LayerInitialVisibility.LayerInitialVisibilityEnum.Show); var layers = MapInitJson.GetConfiguredGeospatialAreaMapLayers(); layers.Add(boundingBoxLayer); var mapInitJson = new MapInitJson("TenantDetailBoundingBoxMap", 10, layers, MapInitJson.GetExternalMapLayers(), BoundingBox.MakeBoundingBoxFromLayerGeoJsonList(new List <LayerGeoJson> { boundingBoxLayer })); var gridSpec = new DetailGridSpec { ObjectNameSingular = "Tenant", ObjectNamePlural = "Tenants", SaveFiltersInCookie = true }; var gridName = "Tenants"; var gridDataUrl = new SitkaRoute <TenantController>(c => c.DetailGridJsonData()).BuildUrlFromExpression(); var costTypes = HttpRequestStorage.DatabaseEntities.CostTypes.ToList().Count > 0 ? string.Join(", ", HttpRequestStorage.DatabaseEntities.CostTypes.Select(x => x.CostTypeName).ToList()) : null; var viewData = new DetailViewData(CurrentFirmaSession, tenant, tenantAttribute, editBasicsUrl, editBoundingBoxUrl, deleteTenantStyleSheetFileResourceUrl, deleteTenantSquareLogoFileResourceUrl, deleteTenantBannerLogoFileResourceUrl, EditBoundingBoxFormID, mapInitJson, gridSpec, gridName, gridDataUrl, editClassificationSystemsUrl, editStylesheetUrl, editTenantLogoUrl, costTypes); return(RazorView <Detail, DetailViewData>(viewData)); }
public static LayerGeoJson MakeObservationsLayerGeoJson(this IEnumerable <OnlandVisualTrashAssessmentObservation> observations) { var featureCollection = observations.ToGeoJsonFeatureCollection(); var observationsLayerGeoJson = new LayerGeoJson("Observations", featureCollection, "#FF00FF", 1, LayerInitialVisibility.Show) { EnablePopups = false }; return(observationsLayerGeoJson); }
public AddOrRemoveParcelsMapIntJson(string mapDivID, LayerGeoJson observationsLayerGeoJson, LayerGeoJson transectLineLayerGeoJson) : base(mapDivID, DefaultZoomLevel, MapInitJsonHelpers.GetJurisdictionMapLayers().ToList(), BoundingBox.MakeBoundingBoxFromLayerGeoJsonList(new List <LayerGeoJson> { observationsLayerGeoJson })) { ObservationsLayerGeoJson = observationsLayerGeoJson; TransectLineLayerGeoJson = transectLineLayerGeoJson; }
public ProjectLocationDetailViewData(int projectID, MapInitJson mapInitJson, LayerGeoJson editableLayerGeoJson, LayerGeoJson arcGisLayerGeoJson, string uploadGisFileUrl, string mapFormID, string saveFeatureCollectionUrl, int annotationMaxLength, bool hasProjectLocationPoint) { ProjectId = projectID; InitJson = mapInitJson; UploadGisFileUrl = uploadGisFileUrl; MapFormId = mapFormID; SaveFeatureCollectionUrl = saveFeatureCollectionUrl; AnnotationMaxLength = annotationMaxLength; HasProjectLocationPoint = hasProjectLocationPoint; ViewDataForAngular = new ProjectLocationDetailViewDataForAngular(mapInitJson, editableLayerGeoJson, arcGisLayerGeoJson, annotationMaxLength); SimplePointMarkerImg = "https://api.tiles.mapbox.com/v3/marker/pin-s-marker+838383.png"; }
public ViewResult Detail(ClassificationPrimaryKey classificationPrimaryKey) { var classification = classificationPrimaryKey.EntityObject; var mapDivID = $"classification_{classification.ClassificationID}_Map"; var associatedProjects = classification.GetAssociatedProjects(CurrentFirmaSession); var currentPersonCanViewProposals = CurrentFirmaSession.CanViewProposals(); var projectMapCustomization = ProjectMapCustomization.CreateDefaultCustomization(associatedProjects, currentPersonCanViewProposals); var projectLocationsLayerGeoJson = new LayerGeoJson($"{FieldDefinitionEnum.ProjectLocation.ToType().GetFieldDefinitionLabelPluralized()}", associatedProjects.MappedPointsToGeoJsonFeatureCollection(false, true, false), "red", 1, LayerInitialVisibility.LayerInitialVisibilityEnum.Show); var projectLocationsMapInitJson = new ProjectLocationsMapInitJson(projectLocationsLayerGeoJson, projectMapCustomization, mapDivID, false) { AllowFullScreen = true, }; // Add Organization Type boundaries according to configuration projectLocationsMapInitJson.Layers.AddRange(HttpRequestStorage.DatabaseEntities.Organizations.GetConfiguredBoundaryLayersGeoJson(). Where(x => x.LayerInitialVisibility == LayerInitialVisibility.LayerInitialVisibilityEnum.Show)); var filteredProjectList = associatedProjects.Where(x1 => x1.HasProjectLocationPointViewableByUser(CurrentFirmaSession)). Where(x => x.ProjectStage.ShouldShowOnMap()).ToList(); // filteredProjectList only contains project location points the user has permission to see projectLocationsMapInitJson.BoundingBox = new BoundingBox(filteredProjectList.Select(x => x.GetProjectLocationPoint(true)).ToList()); var projectLocationsMapViewData = new ProjectLocationsMapViewData(projectLocationsMapInitJson.MapDivID, ProjectColorByType.ProjectStage.GetDisplayNameFieldDefinition(), MultiTenantHelpers.GetTopLevelTaxonomyTiers(), currentPersonCanViewProposals); var projectFundingSourceExpenditures = associatedProjects.SelectMany(x => x.ProjectFundingSourceExpenditures); var organizationTypes = HttpRequestStorage.DatabaseEntities.OrganizationTypes.ToList(); const string chartTitle = "Reported Expenditures By Organization Type"; var chartContainerID = chartTitle.Replace(" ", ""); var googleChart = projectFundingSourceExpenditures.ToGoogleChart(x => x.FundingSource.Organization.OrganizationType.OrganizationTypeName, organizationTypes.Select(x => x.OrganizationTypeName).ToList(), x => x.FundingSource.Organization.OrganizationType.OrganizationTypeName, chartContainerID, chartTitle, organizationTypes.ToDictionary(x => x.OrganizationTypeName, x => x.LegendColor)); var viewGoogleChartViewData = new ViewGoogleChartViewData(googleChart, chartTitle, 405, true); var performanceMeasures = associatedProjects .SelectMany(x => x.PerformanceMeasureActuals) .Select(x => x.PerformanceMeasure).Distinct(new HavePrimaryKeyComparer <PerformanceMeasure>()) .OrderBy(x => x.PerformanceMeasureDisplayName) .ToList(); var projectCustomDefaultGridConfigurations = HttpRequestStorage.DatabaseEntities.ProjectCustomGridConfigurations.Where(x => x.IsEnabled && x.ProjectCustomGridTypeID == ProjectCustomGridType.Default.ProjectCustomGridTypeID).OrderBy(x => x.SortOrder).ToList(); var viewData = new DetailViewData(CurrentFirmaSession, classification, projectLocationsMapViewData, projectLocationsMapInitJson, viewGoogleChartViewData, performanceMeasures, projectCustomDefaultGridConfigurations); return(RazorView <Detail, DetailViewData>(viewData)); }
public static LayerGeoJson GetAssessmentAreaLayerGeoJson(this Models.OnlandVisualTrashAssessmentArea onlandVisualTrashAssessmentArea) { var geoJsonFeatureCollection = new List <Models.OnlandVisualTrashAssessmentArea> { onlandVisualTrashAssessmentArea } .ToGeoJsonFeatureCollection(); var assessmentAreaLayerGeoJson = new LayerGeoJson("parcels", geoJsonFeatureCollection, "#ffff00", .5m, LayerInitialVisibility.Show); return(assessmentAreaLayerGeoJson); }
public ProjectLocationDetailViewData(int projectID, MapInitJson mapInitJson, LayerGeoJson editableLayerGeoJson, string uploadGisFileUrl, string mapFormID, string saveFeatureCollectionUrl, int annotationMaxLength, bool hasProjectLocationPoint, bool locationIsPrivate) { ProjectID = projectID; MapInitJson = mapInitJson; EditableLayerGeoJson = editableLayerGeoJson; UploadGisFileUrl = uploadGisFileUrl; MapFormID = mapFormID; SaveFeatureCollectionUrl = saveFeatureCollectionUrl; AnnotationMaxLength = annotationMaxLength; HasProjectLocationPoint = hasProjectLocationPoint; SimplePointMarkerImg = "https://api.tiles.mapbox.com/v3/marker/pin-s-marker+838383.png"; LocationIsPrivate = locationIsPrivate; FieldDefinitionForProject = FieldDefinitionEnum.Project.ToType(); }
public ViewResult Index() { var stormwaterJurisdictionsPersonCanView = CurrentPerson.GetStormwaterJurisdictionsPersonCanView().ToList(); if (!stormwaterJurisdictionsPersonCanView.Any()) { throw new SitkaRecordNotAuthorizedException( "You are not assigned to any Jurisdictions. Please log out and log in as a different user or request additional permissions"); } var stormwaterJurisdictionIDsPersonCanView = stormwaterJurisdictionsPersonCanView.Select(x => x.StormwaterJurisdictionID); var treatmentBmps = CurrentPerson.GetTreatmentBmpsPersonCanView(); var treatmentBMPLayerGeoJson = new LayerGeoJson("Treatment BMPs", treatmentBmps.ToGeoJsonFeatureCollectionForTrashMap(), "blue", 1, LayerInitialVisibility.Show) { EnablePopups = false }; var parcels = HttpRequestStorage.DatabaseEntities.Parcels.Include(x => x.WaterQualityManagementPlanParcels).Include(x => x.WaterQualityManagementPlanParcels.Select(y => y.WaterQualityManagementPlan)).Where(x => x.WaterQualityManagementPlanParcels.Any()).ToList(); var parcelLayerGeoJson = new LayerGeoJson("Parcels", parcels.ToGeoJsonFeatureCollectionForTrashMap(), "blue", 1, LayerInitialVisibility.Show) { EnablePopups = false }; var boundingBox = BoundingBox.GetBoundingBox(stormwaterJurisdictionsPersonCanView); var geoJsonForJurisdictions = StormwaterJurisdiction.ToGeoJsonFeatureCollection(stormwaterJurisdictionsPersonCanView); var jurisdictionLayersGeoJson = new List <LayerGeoJson> { new LayerGeoJson(MapInitJsonHelpers.CountyCityLayerName, geoJsonForJurisdictions, "#FF6C2D", 0m, LayerInitialVisibility.Hide) }.ToList(); var ovtaBasedMapInitJson = new TrashModuleMapInitJson("ovtaBasedResultsMap", treatmentBMPLayerGeoJson, parcelLayerGeoJson, boundingBox, jurisdictionLayersGeoJson) { LayerControlClass = "ovta-based-map-layer-control" }; var areaBasedMapInitJson = new StormwaterMapInitJson("areaBasedResultsMap", boundingBox, jurisdictionLayersGeoJson) { LayerControlClass = "area-based-map-layer-control" }; var loadBasedMapInitJson = new StormwaterMapInitJson("loadBasedResultsMap", boundingBox, jurisdictionLayersGeoJson) { LayerControlClass = "load-based-map-layer-control" }; var neptunePage = NeptunePage.GetNeptunePageByPageType(NeptunePageType.TrashHomePage); var viewData = new IndexViewData(CurrentPerson, neptunePage, ovtaBasedMapInitJson, areaBasedMapInitJson, loadBasedMapInitJson, treatmentBmps, TrashCaptureStatusType.All, parcels, stormwaterJurisdictionsPersonCanView, geoJsonForJurisdictions); return(RazorView <Index, IndexViewData>(viewData)); }
public static LayerGeoJson GetTransectLineLayerGeoJson(this Models.OnlandVisualTrashAssessmentArea onlandVisualTrashAssessmentArea) { if (onlandVisualTrashAssessmentArea.TransectLine != null) { var featureCollection = new FeatureCollection(); var feature = DbGeometryToGeoJsonHelper.FromDbGeometryWithReprojectionCheck(onlandVisualTrashAssessmentArea.TransectLine); featureCollection.Features.AddRange(new List <Feature> { feature }); LayerGeoJson transectLineLayerGeoJson = new LayerGeoJson("transectLine", featureCollection, "#000000", 1, LayerInitialVisibility.Show); return(transectLineLayerGeoJson); } return(null); }
public ViewResult Detail(TaxonomyTrunkPrimaryKey taxonomyTrunkPrimaryKey) { var taxonomyTrunk = taxonomyTrunkPrimaryKey.EntityObject; var taxonomyTrunkProjects = taxonomyTrunk.GetAssociatedProjects(CurrentFirmaSession).ToList(); var projectMapCustomization = new ProjectMapCustomization(ProjectLocationFilterType.TaxonomyTrunk, new List <int> { taxonomyTrunk.TaxonomyTrunkID }, ProjectColorByType.ProjectStage); var projectLocationsLayerGeoJson = new LayerGeoJson($"{FieldDefinitionEnum.ProjectLocation.ToType().GetFieldDefinitionLabel()}", taxonomyTrunkProjects.MappedPointsToGeoJsonFeatureCollection(false, true, true), "red", 1, LayerInitialVisibility.LayerInitialVisibilityEnum.Show); var projectLocationsMapInitJson = new ProjectLocationsMapInitJson(projectLocationsLayerGeoJson, projectMapCustomization, "TaxonomyTrunkProjectMap", false); var projectLocationsMapViewData = new ProjectLocationsMapViewData(projectLocationsMapInitJson.MapDivID, ProjectColorByType.ProjectStage.GetDisplayNameFieldDefinition(), MultiTenantHelpers.GetTopLevelTaxonomyTiers(), CurrentFirmaSession.CanViewProposals()); var associatePerformanceMeasureTaxonomyLevel = MultiTenantHelpers.GetAssociatePerformanceMeasureTaxonomyLevel(); var canHaveAssociatedPerformanceMeasures = associatePerformanceMeasureTaxonomyLevel == TaxonomyLevel.Trunk; var taxonomyTierPerformanceMeasures = taxonomyTrunk.GetTaxonomyTierPerformanceMeasures(); var relatedPerformanceMeasuresViewData = new RelatedPerformanceMeasuresViewData( associatePerformanceMeasureTaxonomyLevel, true, taxonomyTierPerformanceMeasures, canHaveAssociatedPerformanceMeasures); List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas = null; if (canHaveAssociatedPerformanceMeasures) { performanceMeasureChartViewDatas = taxonomyTierPerformanceMeasures.Select(x => new PerformanceMeasureChartViewData(x.Key, CurrentFirmaSession, false, new List <Project>())).ToList(); } var taxonomyLevel = MultiTenantHelpers.GetTaxonomyLevel(); var projectCustomDefaultGridConfigurations = HttpRequestStorage.DatabaseEntities.ProjectCustomGridConfigurations.Where(x => x.IsEnabled && x.ProjectCustomGridTypeID == ProjectCustomGridType.Default.ProjectCustomGridTypeID).OrderBy(x => x.SortOrder).ToList(); var viewData = new DetailViewData(CurrentFirmaSession, taxonomyTrunk, projectLocationsMapInitJson, projectLocationsMapViewData, canHaveAssociatedPerformanceMeasures, relatedPerformanceMeasuresViewData, performanceMeasureChartViewDatas, taxonomyLevel, projectCustomDefaultGridConfigurations); return(RazorView <Detail, DetailViewData>(viewData)); }
private PartialViewResult ViewEditBoundingBox(EditBoundingBoxViewModel viewModel, TenantAttribute tenantAttribute) { var boundingBoxLayer = new LayerGeoJson("Bounding Box", new FeatureCollection(new List <TenantAttribute> { tenantAttribute } .Select(x => DbGeometryToGeoJsonHelper.FromDbGeometry(x.DefaultBoundingBox)).ToList()), FirmaHelpers.DefaultColorRange[0], 0.8m, LayerInitialVisibility.LayerInitialVisibilityEnum.Show); var mapInitJson = new MapInitJson("TenantEditBoundingBoxMap", 10, MapInitJson.GetConfiguredGeospatialAreaMapLayers(), MapInitJson.GetExternalMapLayers(), BoundingBox.MakeBoundingBoxFromLayerGeoJsonList(new List <LayerGeoJson> { boundingBoxLayer })); var editBoundingBoxUrl = new SitkaRoute <TenantController>(c => c.EditBoundingBox()).BuildUrlFromExpression(); var viewData = new EditBoundingBoxViewData(mapInitJson, editBoundingBoxUrl, EditBoundingBoxFormID); return(RazorPartialView <EditBoundingBox, EditBoundingBoxViewData, EditBoundingBoxViewModel>(viewData, viewModel)); }
public ProjectFinderOrganizationViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.Organization organization, List <PartnerOrganizationMatchMakerScore> projectMatchmakerScoresForOrganization, ProjectFinderGridSpec projectFinderGridSpec, ProjectLocationsMapInitJson projectLocationsMapInitJson, LayerGeoJson matchMakerAreaOfInterestGeoJson) : base(currentFirmaSession) { ContainerFluid = true; PageTitle = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} Finder"; PageSubTitle = $"({organization.OrganizationName})"; ProjectFinderGridSpec = projectFinderGridSpec; ProjectFinderGridName = "projectFinderGrid"; ProjectFinderGridDataUrl = SitkaRoute <ProjectFinderController> .BuildUrlFromExpression(tc => tc.ProjectFinderGridFullJsonData(organization.OrganizationID)); Organization = organization; LegendFormats = ProjectMapLegendElement.BuildLegendFormatDictionary(MultiTenantHelpers.GetTopLevelTaxonomyTiers(), true); ProjectLocationsMapInitJson = projectLocationsMapInitJson; MatchMakerAreaOfInterestGeoJson = matchMakerAreaOfInterestGeoJson; }
private ViewResult ViewDetail(RegionalSubbasinRevisionRequest regionalSubbasinRevisionRequest) { var geometry = regionalSubbasinRevisionRequest.RegionalSubbasinRevisionRequestGeometry; var feature = DbGeometryToGeoJsonHelper.FromDbGeometryWithReprojectionCheck(geometry); var layerGeoJson = new LayerGeoJson("centralizedDelineationLayer", new FeatureCollection(new List <Feature> { feature }), "#ffff00", .5m, LayerInitialVisibility.Show); var mapInitJson = new RegionalSubbasinRevisionRequestMapInitJson("revisionRequestMap", MapInitJson.DefaultZoomLevel, new List <LayerGeoJson>(), new BoundingBox(new List <DbGeometry> { geometry }), layerGeoJson); var viewData = new DetailViewData(CurrentPerson, regionalSubbasinRevisionRequest, mapInitJson); return(RazorView <Detail, DetailViewData>(viewData)); }
private ViewResult ViewNew(NewViewModel viewModel, TreatmentBMP treatmentBMP) { var geometry = treatmentBMP.GetCentralizedDelineationGeometry4326(HttpRequestStorage.DatabaseEntities); var feature = DbGeometryToGeoJsonHelper.FromDbGeometryWithNoReproject(geometry); var layerGeoJson = new LayerGeoJson("centralizedDelineationLayer", new FeatureCollection(new List <Feature> { feature }), "#ffff00", .5m, LayerInitialVisibility.Show); var mapInitJson = new RegionalSubbasinRevisionRequestMapInitJson("revisionRequestMap", MapInitJson.DefaultZoomLevel, new List <LayerGeoJson>(), new BoundingBox(new List <DbGeometry> { geometry }), layerGeoJson); var viewData = new NewViewData(CurrentPerson, treatmentBMP, mapInitJson); return(RazorView <New, NewViewData, NewViewModel>(viewData, viewModel)); }
public ViewResult Detail(RegionalSubbasinPrimaryKey regionalSubbasinPrimaryKey) { var regionalSubbasin = regionalSubbasinPrimaryKey.EntityObject; var regionalSubbasinCatchmentGeometry4326 = regionalSubbasin.CatchmentGeometry4326; var geoJson = DbGeometryToGeoJsonHelper.FromDbGeometryWithNoReproject(regionalSubbasinCatchmentGeometry4326); var geoJsonFeatureCollection = new FeatureCollection(new List <Feature> { geoJson }); var layerGeoJson = new LayerGeoJson("Catchment Boundary", geoJsonFeatureCollection, "#000000", 1, LayerInitialVisibility.Show, false); var stormwaterMapInitJson = new StormwaterMapInitJson("map", MapInitJson.DefaultZoomLevel, new List <LayerGeoJson> { layerGeoJson }, new BoundingBox(regionalSubbasinCatchmentGeometry4326)); var hruCharacteristics = regionalSubbasin.GetHRUCharacteristics().ToList(); return(RazorView <Detail, DetailViewData>(new DetailViewData(CurrentPerson, regionalSubbasin, new HRUCharacteristicsViewData(regionalSubbasin, hruCharacteristics), stormwaterMapInitJson, hruCharacteristics.Any()))); }
public ViewResult Index(GeospatialAreaTypePrimaryKey geospatialAreaTypePrimaryKey) { var geospatialAreaType = geospatialAreaTypePrimaryKey.EntityObject; var layerGeoJsons = new List <LayerGeoJson> { geospatialAreaType.GetGeospatialAreaWmsLayerGeoJson("#59ACFF", 0.2m, LayerInitialVisibility.LayerInitialVisibilityEnum.Show) }; var currentPersonCanViewProposals = CurrentFirmaSession.CanViewProposals(); var projectsToShow = ProjectMapCustomization.ProjectsForMap(currentPersonCanViewProposals, CurrentFirmaSession); var projectLocationsLayerGeoJson = new LayerGeoJson($"Mapped {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}", projectsToShow.MappedPointsToGeoJsonFeatureCollection(false, true, true), "#80b2ff", 1, LayerInitialVisibility.LayerInitialVisibilityEnum.Show); layerGeoJsons.Add(projectLocationsLayerGeoJson); var mapInitJson = new MapInitJson("geospatialAreaIndex", 10, layerGeoJsons, MapInitJson.GetExternalMapLayers(), BoundingBox.MakeNewDefaultBoundingBox()); var viewData = new IndexViewData(CurrentFirmaSession, geospatialAreaType, mapInitJson); return(RazorView <Index, IndexViewData>(viewData)); }