Purpose
Removes one or more layers from a Map window. You can issue this statement from the MapBasic window in MapInfo Pro.
Syntax
Remove Map [ Window window_id ]
Layer map_layer [ , map_layer ... ] |
GroupLayer group_id [ , group_id ... ]
[ Interactive ]
window_id is the integer window identifier of a Map window; to obtain a window identifier, call the FrontWindow() function or the WindowID() function.
map_layer specifies which map layer(s) to remove; see examples below.
Description
The Remove Map statement removes one or more layers or group layers from a Map window. If no window_id is provided, the statement affects the topmost Map window.
The group_id can be an integer greater than zero to denote a specific group in the map, or the name of a group layer. If it is the name of a group layer, the first group layer in the list from the top down with the same name will be removed. Since the map_layer also refers to a unique identifier it can refer to a map layer in any group. But to remove an entire group, and all of its nested groups, use the GroupLayer clause.The map_layer parameter can be an integer greater than zero, a string containing the name of a table, or the keyword Animate, as summarized in the following table.
Examples | Descriptions of Examples |
---|---|
|
If you specify "1" (one) as the map_layer parameter, the top map layer (other than the Cosmetic layer) is removed. Specify "1, 2" to remove the top two layers.
Example:
This removes the first group layer in the list. |
|
The Zones layer is removed (assuming that one of the layers in the map is named "Zones"). |
|
The first thematic layer based on the Zones layer is removed. |
|
The animation layer is removed. To learn how to add an animation layer, see Add Map statement. |
If you include the Interactive keyword, and if the layer removal will cause the loss of labels or themes, MapInfo Pro displays a dialog box that allows the user to save (a workspace), discard the labels and themes, or cancel the layer removal. If you omit the Interactive keyword, the user is not prompted.
A Remove Map statement does not close any tables; it only affects the number of layers displayed in the Map window. If a Remove Map statement removes the last non-cosmetic layer in a Map window, MapInfo Pro automatically closes the window.
See Also:
Create Map statement, Map statement, Set Map statement