How to add your knowledge

Enumerating Map Layers

    Table of contents
    1. 1. Topics in this section

    Map layers are contained within an MgMap object. To list the layers in a map, use the MgMap::GetLayers() method. This returns an MgLayerCollection object.

    To retrieve a single layer, use the MgLayerCollection::GetItem method with either an integer index or a layer name. The layer name is the name as defined in the map, not the name of the layer definition in the repository.

    For example:

    $layer = $layers->GetItem('Roads');
    

    Topics in this section