// This is called for editor maps where layer initial visibility may be different from what's configured on the GeospatialAreaType
 public static LayerGeoJson GetGeospatialAreaWmsLayerGeoJson(this GeospatialAreaType geospatialAreaType,
                                                             string layerColor, decimal layerOpacity,
                                                             LayerInitialVisibility.LayerInitialVisibilityEnum layerInitialVisibility)
 {
     return(new LayerGeoJson(geospatialAreaType.GeospatialAreaTypeNamePluralized,
                             geospatialAreaType.MapServiceUrl(),
                             geospatialAreaType.GeospatialAreaLayerName, MapTooltipUrlTemplate.UrlTemplateString, layerColor,
                             layerOpacity,
                             layerInitialVisibility));
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor for LayerGeoJson with Vector Type
 /// </summary>
 public LayerGeoJson(string layerName, FeatureCollection geoJsonFeatureCollection, string layerColor, decimal layerOpacity, LayerInitialVisibility.LayerInitialVisibilityEnum 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"));
 }
Esempio n. 3
0
 /// <summary>
 /// Constructor for LayerGeoJson with WMS Type
 /// </summary>
 public LayerGeoJson(string layerName, string mapServerUrl, string mapServerLayerName, string tooltipUrlTemplate, string layerColor, decimal layerOpacity, LayerInitialVisibility.LayerInitialVisibilityEnum layerInitialVisibility)
 {
     LayerName              = layerName;
     MapServerUrl           = mapServerUrl;
     MapServerLayerName     = mapServerLayerName;
     TooltipUrlTemplate     = tooltipUrlTemplate;
     LayerColor             = layerColor;
     LayerOpacity           = layerOpacity;
     LayerInitialVisibility = layerInitialVisibility;
     LayerType              = LayerGeoJsonType.Wms;
 }