ArcGIS Runtime SDK for WPF - Library Reference
ArcGISLocalDynamicMapServiceLayer Class
Members  Example  See Also 
ESRI.ArcGIS.Client.Local Namespace : ArcGISLocalDynamicMapServiceLayer Class

Represents an ArcGIS dynamic map service layer for which the supporting service is a local map service hosted by the runtime local server.

Object Model

ArcGISLocalDynamicMapServiceLayer ClassDynamicLayerInfoCollection ClassDynamicLayerInfo ClassEnvelope ClassEnvelope ClassLayerDrawingOptionsCollection ClassLayerDrawingOptions ClassLayerInfo ClassLayerTimeOptionCollection ClassTimeOption ClassLocalMapService ClassSpatialReference ClassTable ClassTimeExtent ClassTimeInfo ClassTimeExtent Class

Syntax

Remarks

An ArcGISLocalDynamicMapServiceLayer allows you to work with a dynamic map service resource serving local data content exposed by the ArcGIS REST API. A dynamic map service generates images on the fly.

ArcGISLocalDynamicMapServiceLayer inherits from ArcGISDynamicMapServiceLayer and provides overloaded constructors, overridden methods, new event handlers and new properties for working with local data content.

ArcGISLocalDynamicMapServiceLayers can be created via one of the overloaded constructors or by setting the the Path property then explicitly calling the overridden Initialize method. In all cases, whether passed as a string in the constructor or used as the seed for a LocalMapService the, the fundamental element is a path to an ArcGIS map package.

The ArcGISLocalDynamicMapServiceLayer initialization will result in one of two events being raised, either ESRI.ArcGIS.Client.Layer.Initialized or ESRI.ArcGIS.Client.Layer.InitializationFailed. It is recommended that these events are handled in order to provide feedback to the user, particularly in the case of an initialization failure where the ESRI.ArcGIS.Client.Layer.InitializationFailure property will contain the Exception.

ArcGISDynamicMapServiceLayers are not shown at design time.

Example

The following example demonstrates how to define an ArcGISLocalDynamicMapServiceLayer in XAML: The following examples demonstrate how to define an ArcGISLocalDynamicMapServiceLayer in code using the static GetServiceAsync:
XAMLCopy Code
<esri:Map x:Name="_map">              
  <esri:ArcGISLocalDynamicMapServiceLayer ID="arcGISLocalDynamicMapServiceLayer" 
           Path="C:\Program Files (x86)\ArcGIS SDKs\WPF1.0\SDK\Samples\Data\MPKs\USCitiesStates.mpk"/>            
</esri:Map>
C#Copy Code
// Create a new local map service instance and supply an ArcGIS map package path as string
LocalMapService.GetServiceAsync(@"C:\Program Files (x86)\ArcGIS SDKs\WPF1.0\SDK\Samples\Data\MPKs\USCitiesStates.mpk",
    delegateService => 
    {
        // Create a new local dynamic layer instance and provide the local map service
        ArcGISLocalDynamicMapServiceLayer arcGISLocalDynamicMapServiceLayer
            = new ArcGISLocalDynamicMapServiceLayer(delegateService);
            
        // Add the local dynamic layer to the map. The map will handle the initialization of the layer.
        _map.Layers.Add(arcGISLocalDynamicMapServiceLayer); 
    });
VB.NETCopy Code
' Create a new local map service instance and supply an ArcGIS map package path as string
LocalMapService.GetServiceAsync("C:\Program Files (x86)\ArcGIS SDKs\WPF1.0\SDK\Samples\Data\MPKs\USCitiesStates.mpk", 
    Function(delegateService) 
        ' Create a new local dynamic layer instance and provide the local map service
        Dim arcGISLocalDynamicMapServiceLayer As New ArcGISLocalDynamicMapServiceLayer(delegateService)
            
        ' Add the local dynamic layer to the map. The map will handle the initialization of the layer which 
        ' in turn will start the local map service if required.  
        _map.Layers.Add(arcGISLocalDynamicMapServiceLayer)
    End Function)

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         ESRI.ArcGIS.Client.Layer
            ESRI.ArcGIS.Client.DynamicLayer
               ESRI.ArcGIS.Client.DynamicMapServiceLayer
                  ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer
                     ESRI.ArcGIS.Client.Local.ArcGISLocalDynamicMapServiceLayer

Requirements

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

See Also

© ESRI, Inc. All Rights Reserved.