Maptitude GISDK Help

AddExistingLayer()

Summary

Adds an existing layer in the workspace to a map.

 

Syntax

actual_lyr_name = AddExistingLayer(string map_name, string layer_name)

 

Argument

Contents

map_name

The name of the map to which the layer is added

layer_name

The name of the layer to add

 

Returns

A string indicating the actual name of the layer, which is identical to layer_name unless the layer name is already in use.

 

Notes

Example

// Before running the example, create a map by opening nesouth.cdf

// and a second map by opening ne_plc.cdf, both in the Tutorial folder.

lyr_info = GetLayers()

if lyr_info[3] <> null then do

    // Add the current layer to another map  

    new_lyr = AddExistingLayer("U.S. Counties", lyr_info[3]) 

    SetMap("U.S. Counties") 

    RunMacro("G30 new layer default settings", new_lyr) 

end 

 

Error Codes

Error Type

Meaning

Error

The map or the specified layer does not exist; or the layer is already in the map

NotFound

The map or the specified layer is not found

 

See Also

Function

Summary

AddCDFLayer()

Adds a layer from a compact geographic file to a map

AddImageLayer()

Adds an image layer to a map

AddLayerToWorkspace()

Adds a layer to a workspace without it appearing in a map or dataview

AddLayer()

Adds a layer from a geographic file to a map

DropLayer()

Removes a layer from a map

GetMapLayers()

Gets a list of the layers in a map

GetLayers()

Gets information on layers in the system and the current layer.

 

 

©2025 Caliper Corporation www.caliper.com