ESRI.ArcGIS.ADF.IMS
ImageLayer Constructor(String,ImageDataset)
See Also  Example
ESRI.ArcGIS.ADF.IMS.Carto.Layer Namespace > ImageLayer Class > ImageLayer Constructor : ImageLayer Constructor(String,ImageDataset)




id
ID of the constructed ImageLayer.
dataset
Dataset of the constructed ImageLayer.
Constructs an ImageLayer object.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal id As String, _
   ByVal dataset As ImageDataset _
)
Visual Basic (Usage)Copy Code
Dim id As String
Dim dataset As ImageDataset
 
Dim instance As ImageLayer(id, dataset)
C# 
public ImageLayer( 
   string id,
   ImageDataset dataset
)

Parameters

id
ID of the constructed ImageLayer.
dataset
Dataset of the constructed ImageLayer.

Example

The following example creates a new ImageLayer from an image file on disk and adds it to the map. It assumes a pre-existing MapView object.
C#Copy Code
// Create a new ImageLayer from a new image workspace and data set 

ImageWorkspace newImageWS = new ImageWorkspace("worldWs", @"C:\Data\World"); 

ImageDataset newDataset = new ImageDataset("world_img.gif", newImageWS); 

ImageLayer dynamicLayer = new ImageLayer("worldImage", newDataset); 

dynamicLayer.Name = "World Image"; 

  

// Insert the dynamic layer into the map layers and draw the map 

mapView.Layers.Insert(3, dynamicLayer); 

    
Visual BasicCopy Code
' Create a new ImageLayer from a new image workspace and data set

Dim newImageWS As New ImageWorkspace("worldWs", "C:\Data\World")

Dim newDataset As New ImageDataset("world_img.gif", newImageWS)

Dim dynamicLayer As New ImageLayer("worldImage", newDataset)

dynamicLayer.Name = "World Image"



' Insert the dynamic layer into the map layers and draw the map

mapView.Layers.Insert(3, dynamicLayer)

Remarks

This method enables creation of dynamic layers, which are new map layers based on spatial data not currently used in the map service. To add a new layer not yet in the map service, you must define the ImageDataset, which specifies the name of the data layer. In the FeatureDataset you must also define the workspace, which can be an existing workspace in the map service (NamedWorkspace) or a new workspace (SdeWorkspace or ImageWorkspace).

Dynamic layers are not supported with ArcMap image services.

The layer ID can be any combination of alpha and numeric characters.

See Also

© 2010 All Rights Reserved.