| Maptitude GISDK Help |
Gets a list of the layers in a map.
Added Image Library as a layer type in Version 5.0.
layer_array = GetMapLayers(string map_name, string layer_type)
| Argument | Contents |
|---|---|
| map_name | The name of the map, or null for the current map |
| layer_type | The layer type of interest, as shown in the table: |
| Layer Type | Meaning |
|---|---|
| All | Include all layers in the list |
| Point | Include only point layers in the list |
| Line | Include only line layers in the list |
| Area | Include only area layers in the list |
| Image | Include only image layers in the list |
| Image Library | Include only image libraries in the list |
| Active | Include all layers whose visibility is "True" even though autoscaling may suppress display |
| Autoscale | Include all layers whose visibility is "True" and that are displayed at the current map scale. This is the actual list of all visible layers in the map. |
An array of 3 elements:
| Element | Type | Contents |
|---|---|---|
| 1 | Array | An array of layer name strings |
| 2 | Integer | The index into that list of the current layer of the specified map |
| 3 | String | The name of the current layer of the specified map |
If the map_name is null, GetMapLayers() returns layers from the current map.
If map_name is null and the current layer is not of type layer_type, the returned array is {null, -1, null}.
The array of layer name strings returned by GetMapLayers() is returned in drawing order from first to last.
Each map stores its own current layer.
ml = GetMapLayers(, "Autoscale")
ShowMessage("There are " + String(ml[1].length) + " layers displayed in the current map.")
| Function | Summary |
|---|---|
| AddLayer() | Adds a layer from a standard geographic file to a map |
| DropLayer() | Removes a layer from a map |
| GetLayer() | Gets the name of the current layer, if any |
| GetLayers() | Gets information on layers in the system and the current layer |
| GetLayerScale() | Gets the range of scales at which a layer displays (autoscale) |
| GetLayerVisibility() | Determines whether a layer is visible (displayed) in a map |
| GetMapCurrentLayer() | Gets the name of the current layer in a map |
| ©2025 Caliper Corporation | www.caliper.com |