AddImageLayer()

Summary

Adds an image layer to a map.

Syntax

actual_lyr_name = AddImageLayer(string map_name, string layer_name, string file_name)

Argument Contents
map_name The name of the map to which the image is added
layer_name The desired name for the image layer
file_name The full path and file name of the image file

Returns

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

Notes

  • The map must be set to the projection of the image layer with SetMapProjection() before the image layer is added.

  • If the image is registered, it is displayed in its correct location.

  • If the image is not already registered, AddImageLayer() automatically fits it into the map window and registers it at that location.

  • Maptitude keeps track of geographic and image files and their layer names in the workspace, not just in individual map windows. The same image file can have the same layer name in different maps, but different geographic or image 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.

Example

lyr = AddImageLayer("Map of New York", "Topo Map", "j:\\nycity.tif")

Error Codes

Error Type Meaning
Error The image file is corrupt or in an unsupported format
NotFound The map or the specified image file does not exist

See Also

Function Summary
AddExistingLayer() Adds an existing layer in the workspace to a map
AddLayer() Adds a layer from a standard geographic file to a map
AddLayerToWorkspace() Adds a layer to a workspace without it appearing in a map or dataview
AddCDFLayer() Adds a layer from a compact format geographic file to a map
GetMapLayers() Gets a list of the layers in a map
GetImageLayerOptions() Gets the display and interpolation specifications of an image layer
DropLayer() Removes a layer from a map
SetImageLayerOptions() Sets the display and interpolation specifications of an image layer.
GetLayers() Gets information on layers in the system and the current layer