Maptitude GISDK Help

AddLayerToWorkspace()

Summary

Adds a layer to an application without it appearing in a map or dataview.

 

Syntax

actual_name = AddLayerToWorkspace(string layer_name, string db_name, string db_layer_name [, array options])

 

Argument Contents
layer_name The desired name for the new layer
db_name Path and file name of the geographic file that contains the layer
db_layer_name The name of the layer in the geographic file

 

Option Type Contents
Read Only Boolean "True" to open read only, "False" (default) otherwise
Shared Boolean "True" to open shared, "False" (default) otherwise; "False" sets the Exclusive mode

 

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

lyr = AddLayerToWorkspace("Counties", "cccntyl.cdf", "County (Low Res)" ,

{{"Shared", "True"}}) 

nrecs = GetRecordCount(lyr, )

DropLayerFromWorkspace(lyr)

ShowMessage("There are " + String(nrecs) + " counties.")

 

Error Codes

Error Type Meaning
Error The db_name file is not a valid geographic file
NotFound The specified path and name do not exist

 

See Also

Function Summary
AddCDFLayer() Adds a layer from a compact geographic file to a map
AddImageLayer() Adds an image layer to a map
AddLayer() Adds a layer from a geographic file to a map
AddExistingLayer() Adds an existing layer in the workspace to a map
DropLayer() Removes a layer from a map
GetLayers() Gets information on layers in the system and the current layer.
DropLayerFromWorkspace() Removes a layer from an application
GetMapLayers() Gets a list of the layers in a map

 

 

 

©2025 Caliper Corporation www.caliper.com