public static List <LayerGeoJson> GetPriorityLandscapeAndAssociatedProjectLayers(PriorityLandscape priorityLandscape, List <Project> projects) { var projectLayerGeoJson = new LayerGeoJson($"{FieldDefinition.ProjectLocation.GetFieldDefinitionLabel()} - Simple", Project.MappedPointsToGeoJsonFeatureCollection(projects, true, false), "#ffff00", 1, LayerInitialVisibility.Show); var priorityLandscapeLayerGeoJson = new LayerGeoJson(priorityLandscape.DisplayName, new List <PriorityLandscape> { priorityLandscape }.ToGeoJsonFeatureCollection(), "#2dc3a1", 1, LayerInitialVisibility.Show); var projectDetailedLocationsLayerGeoJson = Project.ProjectDetailedLocationsToGeoJsonFeatureCollection(projects); var projectTreatmentAreasLayerGeoJson = Project.ProjectTreatmentAreasToGeoJsonFeatureCollection(projects); var layerGeoJsons = new List <LayerGeoJson> { projectLayerGeoJson, priorityLandscapeLayerGeoJson, GetPriorityLandscapeWmsLayerGeoJson("#59ACFF", 0.6m, LayerInitialVisibility.Show), projectDetailedLocationsLayerGeoJson, projectTreatmentAreasLayerGeoJson }; return(layerGeoJsons); }
public static List <LayerGeoJson> GetGisFeatureLayers(GisFeature gisFeature) { var gisFeatureLayer = new LayerGeoJson(gisFeature.GisFeatureID.ToString(), new List <GisFeature> { gisFeature }.ToGeoJsonFeatureCollection(), "#2dc3a1", 1, LayerInitialVisibility.Show); var layerGeoJsons = new List <LayerGeoJson> { gisFeatureLayer }; return(layerGeoJsons); }
public static LayerGeoJson ProjectDetailedLocationsToGeoJsonFeatureCollection(List <Project> projects) { var projectIDs = projects.Select(x => x.ProjectID).ToList(); var projectLocations = HttpRequestStorage.DatabaseEntities.ProjectLocations .Where(x => projectIDs.Contains(x.ProjectID)).ToList(); var detailedLocationsByTypeGeoJsonFeatureCollection = projectLocations.ToGeoJsonFeatureCollectionWithPopupUrl(); var layerGeoJson = new LayerGeoJson($"{Models.FieldDefinition.ProjectLocation.GetFieldDefinitionLabel()} - Detail", detailedLocationsByTypeGeoJsonFeatureCollection, "#ed5e0b", (decimal)0.3, LayerInitialVisibility.Hide); layerGeoJson.LayerIconImageLocation = "/Content/leaflet/images/washington_location_detailed.png"; return(layerGeoJson); }
public static List <LayerGeoJson> GetRegionAndAssociatedProjectLayers(DNRUplandRegion dnrUplandRegion, List <Project> projects) { var projectLayerGeoJson = new LayerGeoJson($"{FieldDefinition.ProjectLocation.GetFieldDefinitionLabel()} - Simple", Project.MappedPointsToGeoJsonFeatureCollection(projects, true, false), "#ffff00", 1, LayerInitialVisibility.Show); var regionLayerGeoJson = new LayerGeoJson(dnrUplandRegion.DisplayName, new List <DNRUplandRegion> { dnrUplandRegion }.ToGeoJsonFeatureCollection(), "#2dc3a1", 1, LayerInitialVisibility.Show); var layerGeoJsons = new List <LayerGeoJson> { projectLayerGeoJson, regionLayerGeoJson, GetRegionWmsLayerGeoJson("#59ACFF", 0.6m, LayerInitialVisibility.Show) }; return(layerGeoJsons); }
public static List <LayerGeoJson> GetGeospatialAreaAndAssociatedProjectLayers(this GeospatialArea geospatialArea, FirmaSession currentFirmaSession, List <Project> projects, out LayerGeoJson projectLayerGeoJson) { projectLayerGeoJson = new LayerGeoJson( $"Mapped {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}", projects.MappedPointsToGeoJsonFeatureCollection(false, true, false), "#ffff00", 1, LayerInitialVisibility.LayerInitialVisibilityEnum.Show); var geospatialAreaLayerGeoJson = new LayerGeoJson(geospatialArea.GeospatialAreaShortName, new List <GeospatialArea> { geospatialArea }.ToGeoJsonFeatureCollection(), "#2dc3a1", 1, LayerInitialVisibility.LayerInitialVisibilityEnum.Show); var layerGeoJsons = new List <LayerGeoJson> { geospatialAreaLayerGeoJson, geospatialArea.GeospatialAreaType.GetGeospatialAreaWmsLayerGeoJson("#59ACFF", 0.6m, LayerInitialVisibility.LayerInitialVisibilityEnum.Show) }; return(layerGeoJsons); }
public static LayerGeoJson ProjectTreatmentAreasToGeoJsonFeatureCollection(List <Project> projects) { var projectIDs = projects.Select(x => x.ProjectID).ToList(); var projectTreatments = HttpRequestStorage.DatabaseEntities.Treatments .Where(x => projectIDs.Contains(x.ProjectID)) .Include(x => x.TreatmentArea) .ToList(); var detailedLocationsByTypeGeoJsonFeatureCollection = projectTreatments.ToGeoJsonFeatureCollectionWithPopupUrl(); var layerName = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} Treatment Areas"; var layerGeoJson = new LayerGeoJson(layerName, detailedLocationsByTypeGeoJsonFeatureCollection, "#355e3b", (decimal)0.3, LayerInitialVisibility.Hide); layerGeoJson.LayerIconImageLocation = "/Content/leaflet/images/washington_project_treatment.png"; return(layerGeoJson); }