Beispiel #1
0
        public static List <LayerGeoJson> GetConfiguredBoundaryLayersGeoJson(this IEnumerable <Organization> organizations)
        {
            var organizationsToShow =
                organizations?.Where(x => x.OrganizationBoundary != null && x.OrganizationType != null && x.OrganizationType.ShowOnProjectMaps).
                OrderBy(x => x.OrganizationName).ToList();

            if (organizationsToShow == null || !organizationsToShow.Any())
            {
                return(new List <LayerGeoJson>());
            }


            return(organizationsToShow.GroupBy(x => x.OrganizationType, (organizationType, organizationList) =>
            {
                return new LayerGeoJson(
                    $"{organizationType.OrganizationTypeName} {FieldDefinitionEnum.Organization.ToType().GetFieldDefinitionLabelPluralized()}",
                    new FeatureCollection(organizationList.Select(organization =>
                {
                    var feature = DbGeometryToGeoJsonHelper.FromDbGeometry(organization.OrganizationBoundary);
                    feature.Properties.Add("Hover Name", UrlTemplate.MakeHrefString(organization.GetDetailUrl(), organization.OrganizationShortName).ToHtmlString());
                    feature.Properties.Add(organizationType.OrganizationTypeName, UrlTemplate.MakeHrefString(organization.GetDetailUrl(), organization.OrganizationName).ToHtmlString());
                    return feature;
                }).ToList()),
                    organizationType.LegendColor, 1,
                    LayerInitialVisibility.GetInitialVisibility(organizationType.LayerOnByDefault)
                    );
            }).ToList());
        }
        public static List <LayerGeoJson> GetRegionMapLayers(LayerInitialVisibility layerInitialVisibility)
        {
            var layerGeoJsons = new List <LayerGeoJson>
            {
                DNRUplandRegion.GetRegionWmsLayerGeoJson("#59ACFF", 0.2m, layerInitialVisibility)
            };

            return(layerGeoJsons);
        }
        public static List <LayerGeoJson> GetPriorityLandscapeMapLayers(LayerInitialVisibility layerInitialVisibility)
        {
            var layerGeoJsons = new List <LayerGeoJson>
            {
                PriorityLandscape.GetPriorityLandscapeWmsLayerGeoJson("#59ACFF", 0.2m, layerInitialVisibility)
            };

            return(layerGeoJsons);
        }
 /// <summary>
 /// Constructor for LayerGeoJson with WMS Type
 /// </summary>
 public LayerGeoJson(string layerName, string mapServerUrl, string mapServerLayerName, string layerColor, decimal layerOpacity, LayerInitialVisibility layerInitialVisibility)
 {
     LayerName = layerName;
     MapServerUrl = mapServerUrl;
     MapServerLayerName = mapServerLayerName;
     LayerColor = layerColor;
     LayerOpacity = layerOpacity;
     LayerInitialVisibility = layerInitialVisibility;
     LayerType = LayerGeoJsonType.Wms;
 }
 /// <summary>
 /// Constructor for LayerGeoJson with Vector Type
 /// </summary>
 public LayerGeoJson(string layerName, FeatureCollection geoJsonFeatureCollection, string layerColor, decimal layerOpacity, LayerInitialVisibility layerInitialVisibility)
 {
     LayerName = layerName;
     GeoJsonFeatureCollection = geoJsonFeatureCollection;
     LayerColor = layerColor.StartsWith("#") ? layerColor : GetColorString(layerColor);
     LayerOpacity = layerOpacity;
     LayerInitialVisibility = layerInitialVisibility;
     LayerType = LayerGeoJsonType.Vector;
     HasCustomPopups = geoJsonFeatureCollection.Features.Any(x => x.Properties.ContainsKey("PopupUrl"));
 }
        public static List <LayerGeoJson> GetAllGeospatialAreaMapLayers(LayerInitialVisibility layerInitialVisibility)
        {
            var layerGeoJsons = new List <LayerGeoJson>
            {
                GetAllSimpleProjectLocations(),
                GetAllDetailedProjectLocations(),
                GetAllProjectTreatments(),
                PriorityLandscape.GetPriorityLandscapeWmsLayerGeoJson("#59ACFF", 0.2m, layerInitialVisibility),
                DNRUplandRegion.GetRegionWmsLayerGeoJson("#59ACFF", 0.2m, layerInitialVisibility)
            };

            return(layerGeoJsons);
        }
Beispiel #7
0
 public static LayerGeoJson GetPriorityLandscapeWmsLayerGeoJson(string layerColor, decimal layerOpacity, LayerInitialVisibility layerInitialVisibility)
 {
     return(new LayerGeoJson("20-Year Plan for eastern WA", FirmaWebConfiguration.WebMapServiceUrl,
                             FirmaWebConfiguration.GetPriorityLandscapeWmsLayerName(), layerColor, layerOpacity,
                             layerInitialVisibility, "/Content/leaflet/images/washington_priority_landscape.png"));
 }
Beispiel #8
0
 public static LayerGeoJson GetRegionWmsLayerGeoJson(string layerColor, decimal layerOpacity, LayerInitialVisibility layerInitialVisibility)
 {
     return(new LayerGeoJson("All DNR Upland Regions", FirmaWebConfiguration.WebMapServiceUrl,
                             FirmaWebConfiguration.GetDNRUplandRegionWmsLayerName(), layerColor, layerOpacity,
                             layerInitialVisibility, "/Content/leaflet/images/washington_upland_region.png"));
 }
Beispiel #9
0
        public static List <LayerGeoJson> GetAllGeospatialAreaMapLayersForFullProjectMap()
        {
            var geospatialAreaTypes = HttpRequestStorage.DatabaseEntities.GeospatialAreaTypes.OrderBy(x => x.GeospatialAreaTypeName)
                                      .ToList();
            var layerGeoJsons = new List <LayerGeoJson>();

            foreach (var geospatialAreaType in geospatialAreaTypes)
            {
                layerGeoJsons.Add(geospatialAreaType.GetGeospatialAreaWmsLayerGeoJson("#59ACFF", 0.2m,
                                                                                      LayerInitialVisibility.GetInitialVisibility(geospatialAreaType.OnByDefaultOnProjectMap)));
            }

            return(layerGeoJsons);
        }