ArcGIS API for Silverlight - Library Reference
Layer Class
Members  See Also  Send comments on this topic
ESRI.ArcGIS.Client Namespace : Layer Class

This is the base class for all geographic data that can be added to the Map Control.

Object Model

Layer ClassEnvelope ClassSpatialReference ClassTimeExtent Class

Syntax

Visual Basic (Declaration) 
Public MustInherit Class Layer 
   Inherits System.Windows.DependencyObject
C# 
public abstract class Layer : System.Windows.DependencyObject 

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. See the following image for a visual example:

Visual representation of layer order in a map.

The first Layer with a valid SpatialReference defines the Map.SpatialReference.

If a Layer fails to initialize due to some problem, the InitializationFailed Event will be raised. It is a good coding practice to provide the user with a graceful exception in the InitializedFailed Event by either stopping the application with a message or letting the user know that one or more Layers are currently unavailable. Otherwise, if no code is provided in the IntializationFailed Event a general application exception will be thrown which could lead to a less than desirable user experience. Some common reasons for a problem with a Layer include: the server that is returning Layer information is down, an incorrect endpoint URL for the Layer was specified, the site that hosts the service needs a cross-site policy file (clientaccesspolicy.xml or crossdomain.xml), the service is secured and requires a token or credentials, etc.

A Layer can only be instantiated on the UI Thread.

There are several layer types that are supported by the SDK. All of the supported layer types are based upon the parent (or base) Layer Class. This means that all child layers that are based upon the parent Layer Class inherit all of the functionality of the parent. This inheritance hierarchy can extend multiple levels to create layers that have different types of functionality which serve specific purposes. Most ArcGIS developers will consume the ‘younger’ child layers in the inheritance hierarchy as this requires the least amount of custom coding. The following simplified set of Class diagrams display the inheritance hierarchy for various layers with the most common ones that developers use being highlighted in yellow which are hyperlinked to the appropriate API Reference documentation.

Hyperlink mappings to useful layer types.

An ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer is a dynamic ArcGIS REST image service layer that allows you to work a with map service resource exposed by the ArcGIS Server REST API (available in ArcGIS Server 9.3 and above). A dynamic map service generates images on the fly. The background color for an ArcGISDynamicMapServiceLayer will always be transparent.

An ESRI.ArcGIS.Client.ArcGISImageServiceLayer is a dynamic ArcGIS REST image service layer that allows you to work with an Image Service resource exposed by the ArcGIS Server REST API (available in ArcGIS Server 9.3 and above). Image Service is new in ArcGIS 9.3 and is optimized for delivering raw or finished imagery that can be RGB, panchromatic, multispectral, or elevation data stored in a geodatabase or file system. Data sources for Image Services can be raster datasets, in formats such as TIFF, MrSID, IMAGINE (IMG), or JPEG2000, as well as raster mosaics.

An ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer is a cached ArcGIS REST map service layer that allows you to work with a cached map service resource exposed by the ArcGIS Server REST API (available in ArcGIS Server 9.3 and above). A cached service accesses pre-created tiles from a cache instead of dynamically rendering images.

An ESRI.ArcGIS.Client.GraphicsLayer is client side layer that renders vector based Graphic objects stored in a GraphicCollection using custom symbols. The Graphic objects that are in a GraphicsLayer have their geometries provided by actions such as executing a query or drawing a shape on the Map. To add a Graphic to a GraphicsLayer, you must:

  • Retrieve the Graphics layer to add the Graphic to
  • Create or retrieve a Graphic
  • Set the Graphic's Geometry, if this hasn't been done for you
  • Apply the Symbol to the Graphic
  • Add the Graphic to the Graphics layer

An ESRI.ArcGIS.Client.FeatureLayer is a special type of GraphicsLayer that allows you to display feature Graphics without writing any managed .NET code (i.e. code-behind). The conceptual document creating a feature layer provides useful information. Like a GraphicsLayer, a FeatureLayer contains and displays Graphic objects on a Map. But unlike a GraphicsLayer, a FeatureLayer has several properties that enable unique functionality:

  • Url - Address of a Map service layer. Feature layers are automatically populated with features from this layer.
  • Where - Query that defines which features in the specified layer are displayed
  • FeatureSymbol - Symbol that is applied to all the Graphics in the layer
  • ClusterFeatures - Boolean that enables clustering of point features

An ESRI.ArcGIS.Client.ElementLayer is a client side layer that allows putting System.Windows.UIElement objects on the Map Control at specific geographic locations. UIElements are things like: Buttons, Textboxes, Labels, TextBlocks, Rectangle, etc. If the Envelope of the UIElement object is set to a one dimensional point then the UIElement will not scale as users zoom in or out of the map. If the Envelope of the UIElement object is set to a two dimensional shape (i.e. it has width and height) then the UIElement will scale in size as users zoom in or out on the map.

An ESRI.ArcGIS.Client.Tasks.GPResultImageLayer is a dynamic image layer that is generated by ArcGIS Server as a result of a Geoprocessing task. The rendering of the image is provided by the ArcGIS Server MapServer when more that 500 features are returned. If less that 500 features are returned from the Geoprocessing task then the developer is responsible for writing code to display the features using a GraphicsLayer. The GPResultImageLayer requires using code-behind to be used.

An ESRI.ArcGIS.Client.Bing.TileLayer is a tiled image map service layer that allows you to work with a cached map service resource exposed by Microsoft’s Bing services. The Bing.TileLayer uses a set of SOAP proxies and value object types rather than REST. The ArcGIS API provides a set of implementation classes which utilize the proxies and value objects internally. The SOAP types must be public due to .NET Framework requirements; however detailed library reference documentation is not included in this help system. See the Bing Maps Web Services SDK for more information. Use of Bing services requires that you generate and provide a token when utilizing ESRI.ArcGIS.Client.Bing components.

An ESRI.ArcGIS.Client.Toolkit.DataSources.GeoRssLayer is a type of GraphicsLayer where geometries are returned via a GeoRSS-Simple data feed. Geometries are returned in Geographic WGS84 SpatialReference. If you are displaying the feed on top of a map in a different projection, they must be re-projected manually when the graphics collection gets features added. The Graphic objects will not have a symbol associated with them. You should specify a Renderer on this layer, or manually assign symbols to the Graphics when the GraphicsCollection gets features added. To have the GeoRssLayer update for tracking real-time events, client side coding using the Update Method is required.

An ESRI.ArcGIS.Client.Toolkit.DataSources.KmlLayer is a type of GraphicsLayer where geometries are returned via an XML based syntax. The source of the KmlLayer can come from either a KML or KMZ file or service. KMZ is a ZIP version of a KML file. KML is an open source specification that is promoted by Google.

An ESRI.ArcGIS.Client.Toolkit.DataSources.HeatMapLayer is a client side generated bitmap layer that is derived from point Geometry objects. The bitmap displays a ‘heat map’ color image (ranging from blue to red to yellow) that demonstrates the spatial intensity of a set of points (HeatMapPoints). The color blue means less spatial intensity of the points. The color red means a moderate clustering of points. The color yellow means a significant cluster of points. The Intensity Property defines the size of the cells in a matrix used to calculate density. An Intensity of 1 shows all of the HeatMapPoints individually. Each bitmap that is generated is based upon current extent of the map for those points that fall within that extent. The HeatMapLayer is not to be used for statistical analysis (the algorithm is unpublished); its purpose is to provide visual clustering trends for points at a given scale. The input point geometries typically come from GeoRSSLayer feeds, a FeatureLayer, a GraphicsLayer, or from user defined points (XAML or code-behind).

An ESRI.ArcGIS.Client.Toolkit.DataSources.OpenStreetMapLayer is a cached image service that is available from OpenStreetMap organization. The OpenStreetMap organization hosts a free editable map of the world that is open to the public to edit and use. There are four different OpenStreetMapLayer Styles supported: Mapnik, Osmarenderer, Cycle Map, and NoName. The projection of the OpenStreetMap data uses the WGS 84 datum and latitude/longitude as the coordinate system.

An ESRI.ArcGIS.Client.Toolkit.DataSources.WmsLayer is a dynamic REST image service layer that conforms to the Open GIS Consortium (OGC) standard. WMS stands for Web Map Service and provides a HTTP interface for requesting geo-registered map images from one or more distributed geospatial databases. ArcGIS Server has the ability to expose WMS data which can be consumed by the WmsLayer. As of the the 2.1 version of this SDK, the WMS versions supported are 1.1.1 and 1.3.

Inheritance Hierarchy

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7

See Also

© ESRI, Inc. All Rights Reserved.