Adds a layer to the Map control. When you add a layer to a Map you're adding it to the top of the Map layers collection; consequently its index is 0.


Namespace: ActualMap.Windows
Assembly: ActualMap (in ActualMap.dll)

Syntax

Visual Basic (Declaration)
Public Function AddLayer( _ 
   ByVal layerSource As Object _ 
) As Layer
C#
public Layer AddLayer(
   object layerSource
)
C++
public:
 Layer AddLayer(
   Object layerSource
) sealed 
J#
public Layer AddLayer(
   object layerSource
)
JScript
public  function AddLayer(
   layerSource : Object
) : Layer

Parameters

layerSource
An object expression representing the full file name of the map file or can be one of DynamicPoints, DynamicLayer or SpatialDatabaseLayer object.

Return Value

The method returns a Layer object.

Exceptions

Exception TypeCondition
ExceptionThrown if an error occurs.

Example

 Copy Code
void Form_Load(object sender, EventArgs e)
{
        map.AddLayer(@"c:/maps/countries.shp"));
}

See Also