Maptitude GISDK Help |
Adds a layer to an application without it appearing in a map or dataview.
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 |
A string indicating the actual name of the layer, which is identical to layer_name unless the layer name is already in use.
The options array is an optional argument.
For backward compatibility, AddLayerToWorkspaceEx() may be used as an alternate function name.
Selection functions that do geographic searching on a layer require that the layer be in a map, not just in the workspace.
Maptitude keeps track of geographic files and their layer names in the workspace, not just in individual map and dataview windows. The same geographic file can have the same layer name in different maps, but different geographic files cannot have the same layer name even if they are in different maps. In the latter case, Maptitude adds a colon and a sequence number to the desired layer name to make the actual layer name unique.
lyr = AddLayerToWorkspace("Counties", "cccntyl.cdf", "County (Low Res)" ,
{{"Shared", "True"}})
nrecs = GetRecordCount(lyr, )
DropLayerFromWorkspace(lyr)
ShowMessage("There are " + String(nrecs) + " counties.")
Error Type |
Meaning |
Error |
The db_name file is not a valid geographic file |
NotFound |
The specified path and name do not exist |
Function |
Summary |
Adds a layer from a compact geographic file to a map |
|
Adds an image layer to a map |
|
Adds a layer from a geographic file to a map |
|
Adds an existing layer in the workspace to a map |
|
Removes a layer from a map |
|
Gets information on layers in the system and the current layer. |
|
Removes a layer from an application |
|
Gets a list of the layers in a map |
©2025 Caliper Corporation | www.caliper.com |