Click or drag to resize

Layer Class

This is the base class for all layer types that can be added to the Map document.
Inheritance Hierarchy
SystemObject
  Esri.ArcGISRuntime.MappingLayer
    More...

Namespace:  Esri.ArcGISRuntime.Mapping
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.11.0
Syntax
public abstract class Layer : INotifyPropertyChanged, 
	ILoadable, ILayerContent

The Layer type exposes the following members.

Properties
  NameDescription
Public propertyAttribution
Gets the attribution text for the layer.
Public propertyCanChangeVisibility
Gets a value indicating whether the layer content's visibility can be changed.
Public propertyDescription
Gets the description for the layer.
Public propertyCode exampleFullExtent
Gets the full extent of the layer, which is the extent where all the data in the layer is contained.
Public propertyCode exampleId
Gets or sets an identifier for the layer
Public propertyIsIdentifyEnabled
Gets a value indicating whether the layer supports the identify operation.
Public propertyIsVisible
Gets or sets a value indicating whether the layer content is visible.
Public propertyItem
Gets the ArcGIS Item
Public propertyLoadError
Gets the load error of the layer, if there is one.
Public propertyCode exampleLoadStatus
Gets the load status of the layer.
Public propertyCode exampleMaxScale
Gets or sets the maximum scale where the layer is visible.
Public propertyCode exampleMinScale
Gets or sets the minimum scale where the layer is visible.
Public propertyCode exampleName
Gets or sets the name of the layer content.
Public propertyCode exampleOpacity
Gets or sets the opacity of the layer.
Public propertyShowInLegend
Gets or sets a value indicating whether the layer content participates in the legend.
Public propertySpatialReference
Gets the spatial reference of the layer.
Public propertyCode exampleSublayerContents
Gets the sub layer contents of a layer content.
Top
Methods
  NameDescription
Public methodCancelLoad
Cancels an ongoing load.
Public methodCode exampleClone
Clones this instance of Layer and its members.
Public methodGetLegendInfosAsync
Returns an immutable list of LegendInfo.
Public methodIsVisibleAtScale
Returns the layer content's effective visibility at the specified scale.
Public methodCode exampleLoadAsync
Initiates loading of a layer
Protected methodOnPropertyChanged
Called when a property changes.
Public methodRetryLoadAsync
Retry loading the layer.
Top
Events
  NameDescription
Public eventLoaded
Occurs when the layer is loaded.
Public eventLoadStatusChanged
Occurs when the layer LoadStatus is changed.
Public eventPropertyChanged
Occurs when a property value changes.
Top
Remarks

A Layer is a representation of geographic data portrayed using symbols and text labels. Multiple layers can be 'stacked' on top of each other to enhance the information displayed for making meaningful decisions. Layers are displayed visually in the Map Control. Layers are drawn bottom to top so the first one in the LayerCollection is drawn first (on the bottom) and each subsequent layer is drawn on top of it, in the order listed.

Layer is the base class for all these layer types:

Layer type2D/3DTime-awareOnline/offlineSources
AnnotationLayer2DNoBothArcGIS feature service, portal item, mobile map package (.mmpk)
ArcGISMapImageLayerBothYesOnlineArcGIS map service
ArcGISSceneLayer3DNoBothScene service or scene package
ArcGISTiledLayerBothNoBothArcGIS tile service, tile package (.tpk/.tpkx)
ArcGISVectorTiledLayer2DNoBothArcGIS vector tile service, vector tile package (.vtpk)
BingMapsLayerBothNoOnlineBing maps
EncLayer2DNoOfflineENC exchange set, ENC cell
FeatureCollectionLayerBothNoBothPortal item, web map, feature set / query result
FeatureLayerBothYesBothArcGIS feature service, WFS, shapefile, GeoPackage, geodatabase
GroupLayerBothNoBothOther layers and group layers
KmlLayerBothYesBothKML file (.kml, .kmz)
IntegratedMeshLayer3DNoBothScene layer package (.slpk)
MobileBasemapLayer2DNoOfflineMobile map package (.mmpk)
OpenStreetMapLayerBothNoOnlineOpenStreetMap.org
PointCloudLayer3DNoBothPortal item, scene layer package (.slpk)
RasterLayerBothYesBothGeoPackage, raster file, ArcGIS Image service
SubtypeFeatureLayer2DNoBothArcGIS feature service, geodatabase
WebTiledLayerBothNoOnlineWeb tile service
WmsLayerBothYesOnlineWMS service
WmtsLayerBothNoOnlineWMTS service
Examples

WPF

Example Name: FeatureLayerUrl

Show features from an online feature service.

Code example screen shot.

C#
// Copyright 2016 Esri.
// 
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific 
// language governing permissions and limitations under the License.

using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using System;

namespace ArcGISRuntime.WPF.Samples.FeatureLayerUrl
{
    [ArcGISRuntime.Samples.Shared.Attributes.Sample(
        name: "Feature layer (feature service)",
        category: "Layers",
        description: "Show features from an online feature service.",
        instructions: "Run the sample and view the feature service as an operational layer on top of the basemap. Zoom and pan around the map to see the features in greater detail.",
        tags: new[] { "feature table", "layer", "layers", "service" })]
    public partial class FeatureLayerUrl
    {
        public FeatureLayerUrl()
        {
            InitializeComponent();

            // Create the UI, setup the control references and execute initialization 
            Initialize();
        }

        private void Initialize()
        {
            // Create new Map with basemap
            Map myMap = new Map(BasemapStyle.ArcGISTerrain);

            // Create and set initial map location
            MapPoint initialLocation = new MapPoint(
                -13176752, 4090404, SpatialReferences.WebMercator);
            myMap.InitialViewpoint = new Viewpoint(initialLocation, 300000);

            // Create uri to the used feature service
            Uri serviceUri = new Uri(
                "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/FeatureServer/9");

            // Create new FeatureLayer from service uri and
            FeatureLayer geologyLayer = new FeatureLayer(serviceUri);

            // Add created layer to the map
            myMap.OperationalLayers.Add(geologyLayer);

            // Assign the map to the MapView
            MyMapView.Map = myMap;
        }
    }
}
XAML
<UserControl x:Class="ArcGISRuntime.WPF.Samples.FeatureLayerUrl.FeatureLayerUrl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <esri:MapView x:Name="MyMapView"/>
    </Grid>
</UserControl>
See Also
Inheritance Hierarchy
SystemObject
  Esri.ArcGISRuntime.MappingLayer
    Esri.ArcGISRuntime.MappingAnnotationLayer
    Esri.ArcGISRuntime.MappingArcGISSceneLayer
    Esri.ArcGISRuntime.MappingArcGISVectorTiledLayer
    Esri.ArcGISRuntime.MappingEncLayer
    Esri.ArcGISRuntime.MappingFeatureCollectionLayer
    Esri.ArcGISRuntime.MappingFeatureLayer
    Esri.ArcGISRuntime.MappingGroupLayer
    Esri.ArcGISRuntime.MappingImageAdjustmentLayer
    Esri.ArcGISRuntime.MappingIntegratedMeshLayer
    Esri.ArcGISRuntime.MappingKmlLayer
    Esri.ArcGISRuntime.MappingMobileBasemapLayer
    Esri.ArcGISRuntime.MappingOpenStreetMapLayer
    Esri.ArcGISRuntime.MappingPointCloudLayer
Additional Examples
Hyperlink to ExampleDescription
AddAnIntegratedMeshLayerView an integrated mesh layer from a scene service.
AddEncExchangeSetDisplay nautical charts per the ENC specification.
AddFeaturesAdd features to a feature layer.
AddPointSceneLayerView a point scene layer from a scene service.
AnalyzeHotspotsUse a geoprocessing service and a set of features to identify statistically significant hot spots and cold spots.
ApplyMosaicRuleApply mosaic rule to a mosaic dataset of rasters.
ArcGISMapImageLayerUrlAdd an ArcGIS Map Image Layer from a URL to a map.
ArcGISTiledLayerUrlLoad an ArcGIS tiled layer from a URL.
ArcGISVectorTiledLayerUrlLoad an ArcGIS Vector Tiled Layer from a URL.
AuthorMapCreate and save a map as an ArcGIS `PortalItem` (i.e. web map).
BrowseWfsLayersBrowse a WFS service for layers and add them to the map.
BufferListGenerate multiple individual buffers or a single unioned buffer around multiple points.
ChangeBlendRendererBlend a hillshade with a raster by specifying the elevation data. The resulting raster looks similar to the original raster, but with some terrain shading, giving it a textured look.
ChangeEncDisplaySettingsConfigure the display of ENC content.
ChangeFeatureLayerRendererChange the appearance of a feature layer with a renderer.
ChangeStretchRendererUse a stretch renderer to enhance the visual contrast of raster data for analysis.
ChangeSublayerRendererApply a renderer to a sublayer.
ChangeSublayerVisibilityChange the visibility of sublayers.
ChangeTimeExtentFilter data in layers by applying a time extent to a MapView.
ClosestFacilityStaticFind routes from several locations to the respective closest facility.
ControlAnnotationSublayerVisibilityUse annotation sublayers to gain finer control of annotation layer subtypes.
CreateAndSaveKmlFileConstruct a KML document and save it as a KMZ file.
CreateFeatureCollectionLayerCreate a Feature Collection Layer from a Feature Collection Table, and add it to a map.
CustomDictionaryStyleUse a custom dictionary style (.stylx) to symbolize features using a variety of attribute values.
DeleteFeaturesDelete features from an online feature service.
DisplayAnnotationDisplay annotation from a feature service URL.
DisplayDrawingStatusGet the draw status of your map view or scene view to know when all layers in the map or scene have finished drawing.
DisplayKmlDisplay KML from a URL, portal item, or local KML file.
DisplayKmlNetworkLinksDisplay a file with a KML network link, including displaying any network link control messages at launch.
DisplayLayerViewStateDetermine if a layer is currently being viewed.
DisplaySubtypeFeatureLayerDisplays a composite layer of all the subtype values in a feature class.
DisplayUtilityAssociationsCreate graphics for utility associations in a utility network.
DisplayWfsDisplay a layer from a WFS service, requesting only features for the current extent.
DistanceMeasurementMeasure distances between two points in 3D.
DownloadPreplannedMapTake a map offline using a preplanned map area.
EditAndSyncFeaturesSynchronize offline edits with a feature service.
EditBranchVersioningCreate, query and edit a specific server version using service geodatabase.
EditFeatureAttachmentsAdd, delete, and download attachments for features from a service.
EditFeatureLinkedAnnotationEdit feature attributes which are linked to annotation through an expression.
EditKmlGroundOverlayEdit the values of a KML ground overlay.
ExportTilesDownload tiles to a local tile cache file stored on the device.
FeatureCollectionLayerFromPortalCreate a feature collection layer from a portal item.
FeatureCollectionLayerFromQueryCreate a feature collection layer to show a query result from a service feature table.
FeatureLayerDefinitionExpressionLimit the features displayed on a map with a definition expression.
FeatureLayerDictionaryRendererConvert features into graphics to show them with mil2525d symbols.
FeatureLayerExtrusionExtrude features based on their attributes.
FeatureLayerGeodatabaseDisplay features from a local geodatabase.
FeatureLayerGeoPackageDisplay features from a local GeoPackage.
FeatureLayerQueryFind features in a feature table which match an SQL query.
FeatureLayerRenderingModeMapRender features statically or dynamically by setting the feature layer rendering mode.
FeatureLayerRenderingModeSceneRender features in a scene statically or dynamically by setting the feature layer rendering mode.
FeatureLayerSelectionSelect features in a feature layer.
FeatureLayerShapefileOpen a shapefile stored on the device and display it as a feature layer with default symbology.
FeatureLayerTimeOffsetDisplay a time-enabled feature layer with a time offset.
FeatureLayerUrlShow features from an online feature service.
FindServiceAreasForMultipleFacilitiesFind the service areas of several facilities from a feature service.
GenerateGeodatabaseGenerate a local geodatabase from an online feature service.
GenerateOfflineMapTake a web map offline.
GenerateOfflineMapWithOverridesTake a web map offline with additional options for each layer.
GeodatabaseTransactionsUse transactions to manage how changes are committed to a geodatabase.
GroupLayersGroup a collection of layers together and toggle their visibility as a group.
IdentifyKmlFeaturesShow a callout with formatted content for a KML feature.
IdentifyLayersIdentify features in all layers in a map. MapView supports identifying features across multiple layers. Because some layer types have sublayers, the sample recursively counts results for sublayers within each layer.
IdentifyRasterCellGet the cell value of a local raster at the tapped location and display the result in a callout.
LineOfSightGeoElementShow a line of sight between two moving objects.
ListKmlContentsList the contents of a KML file.
LoadWebTiledLayerDisplay a tiled web layer.
LocalServerFeatureLayerStart a local feature service and display its features in a map.
LocalServerGeoprocessingCreate contour lines from local raster data using a local geoprocessing package `.gpk` and the contour geoprocessing tool.
LocalServerMapImageLayerStart the Local Server and Local Map Service, create an ArcGIS Map Image Layer from the Local Map Service, and add it to a map.
ManageOperationalLayersAdd, remove, and reorder operational layers in a map.
MapImageLayerTablesFind features in a spatial table related to features in a non-spatial table.
MapImageSublayerQueryFind features in a sublayer based on attributes and location.
OfflineBasemapByReferenceUse the `OfflineMapTask` to take a web map offline, but instead of downloading an online basemap, use one which is already on the device.
OfflineGeocodeGeocode addresses to locations and reverse geocode locations to addresses offline.
OfflineRoutingSolve a route on-the-fly using offline data.
PerformValveIsolationTraceRun a filtered trace to locate operable features that will isolate an area from the flow of network resources.
PlayKmlToursPlay tours in KML files.
QueryFeatureCountAndExtentZoom to features matching a query and count the features in the current visible extent.
RasterColormapRendererApply a colormap renderer to a raster.
RasterHillshadeUse a hillshade renderer on a raster.
RasterLayerFileCreate and use a raster layer made from a local raster file.
RasterLayerGeoPackageDisplay a raster contained in a GeoPackage.
RasterLayerImageServiceRasterCreate a raster layer from a raster image service.
RasterLayerRasterFunctionLoad a raster from a service, then apply a function to it.
RasterRenderingRuleDisplay a raster on a map and apply different rendering rules to that raster.
RasterRgbRendererApply an RGB renderer to a raster layer to enhance feature visibility.
ReadGeoPackageAdd rasters and feature tables from a GeoPackage to a map.
ReadShapefileMetadataRead a shapefile and display its metadata.
RenderUniqueValuesRender features in a layer using a distinct symbol for each unique attribute value.
SceneLayerSelectionIdentify features in a scene to select.
SceneLayerUrlDisplay an ArcGIS scene layer from a URL.
SelectEncFeaturesSelect features in an ENC layer.
ServiceFeatureTableCacheDisplay a feature layer from a service using the **on interaction cache** feature request mode.
ServiceFeatureTableManualCacheDisplay a feature layer from a service using the **manual cache** feature request mode.
ServiceFeatureTableNoCacheDisplay a feature layer from a service using the **no cache** feature request mode.
SetMapSpatialReferenceSpecify a map's spatial reference.
ShowLabelsOnLayerDisplay custom labels on a feature layer.
StatisticalQueryQuery a table to get aggregated statistics back for a specific field.
StyleWmsLayerChange the style of a Web Map Service (WMS) layer.
SurfacePlacementsPosition graphics relative to a surface using different surface placement modes.
SymbolizeShapefileDisplay a shapefile with custom symbology.
TimeBasedQueryQuery data using a time extent.
TraceUtilityNetworkDiscover connected features in a utility network using connected, subnetwork, upstream, and downstream traces.
UpdateAttributesUpdate feature attributes in an online feature service.
UpdateGeometriesUpdate a feature's location in an online feature service.
ViewPointCloudDataOfflineDisplay local 3D point cloud data.
ViewshedCameraAnalyze the viewshed for a camera. A viewshed shows the visible and obstructed areas from an observer's vantage point.
ViewshedGeoElementAnalyze the viewshed for an object (GeoElement) in a scene.
ViewshedLocationPerform a viewshed analysis from a defined vantage point.
WfsXmlQueryLoad a WFS feature table using an XML query.
WmsIdentifyIdentify features in a WMS layer and display the associated popup content.
WMSLayerUrlDisplay a WMS layer using a WMS service URL.
WmsServiceCatalogConnect to a WMS service and show the available layers and sublayers.
WMTSLayerDisplay a layer from a Web Map Tile Service.