[tail]

Chapter 9
The mapinfo related commands

MapInfo objects are used to describe graphical primitives that will be displayed in map items. It is possible to describe lines, arcs, symbols and texts as part of a MapInfo. The mapinfo and videomap commands are provided to create and manipulate the mapinfo objects.

9.1 The mapinfo command

mapinfo name create
$mainwindow->mapinfo(name, create, )

Create a new empty map description. The new mapinfo object named name.

mapinfo mapInfoName delete
$mainwindow->mapinfo(mapInfoName, delete, )

Delete the mapinfo object named by mapInfoName. All maps that refer to the deleted mapinfo are updated to reflect the change.

mapinfo mapInfoName duplicate newName
$mainwindow->mapinfo(mapInfoName, duplicate, newName)

Create a new mapinfo that is a exact copy of the mapinfo named mapInfoName. The new mapinfo object will be named newName.

mapinfo name add type args
$mainwindow->mapinfo(name, add, type args)

Add a new graphical element to the mapinfo object named by name. The type parameter select which element should be added while the args arguments provide some type specific values such as coordinates. Here is a description of recognized types and their associated parameters.

line
This element describes a line segment. Its parameters consists in a line style (simple, dashed, dotted, mixed, marked), an integer value setting the line width in pixels and four integer values setting the X and Y coordinates of the two end vertices.
arc
This element describes an arc segment. Its parameters consists in a line style (simple, dashed, dotted, mixed, marked), an integer value setting the line width in pixels, two integer values setting the X and Y of the arc center, integer value setting the arc radius and two integer values setting the start angle (in degree) and the angular extent of the arc (in degree).
symbol
This element describes a symbol. Its parameters consists in two integer values setting the X and Y of the symbol position and an integer setting the symbol index in the -symbols list of the map item.
text
This element describes a line of text. Its parameters consists in a text style (normal, underlined), a line style (simple, dashed, dotted, mixed, marked) to be used for the underline, two integer values setting the X and Y of the text position and a string describing the text.

mapinfo name count type
$mainwindow->mapinfo(name, count, type)

Return an integer value that is the number of elements matching type in the mapinfo named name. type may be one the legal element types as described in the mapinfo add command.

mapinfo name get type index
$mainwindow->mapinfo(name, get, type index)

Return the parameters of the element at index with type type in the mapinfo named name. The returned value is a list. The exact number of parameters in the list and their meaning depend on type and is accurately described in mapinfo add. type may be one the legal element types as described in the mapinfo add command. Indices are zero based and elements are listed by type.

mapinfo name replace type index args
$mainwindow->mapinfo(name, replace, type index args)

Replace all parameters for the element at index with type type in the mapinfo named name. The exact number and content for args depend on type and is accurately described in mapinfo add. type may be one the legal element types as described in the mapinfo add command. Indices are zero based and elements are listed by type.

mapinfo name remove type index
$mainwindow->mapinfo(name, remove, type index)

Remove the element at index with type type in the mapinfo named name. type may be one the legal element types as described in the mapinfo add command. Indices are zero based and elements are listed by type.

mapinfo name scale factor
$mainwindow->mapinfo(name, scale, factor)

Scale all coordinates of all the elements described in the mapinfo named name by factor. The same value is used for X and Y axes.

mapinfo name translate xAmount yAmount
$mainwindow->mapinfo(name, translate, xAmount yAmount)

Translate all coordinates of all the elements described in the mapinfo named name. The xAmount value is used for the X axis and the yAmount value is used for the Y axis.

9.2 The videomap command

This section describes the videomap command, used to create a mapinfo from a proprietary file format for simple maps, in use in french Air Traffic Control Centres. The format is the binary cautra4 (with x and y in 1/8nm units)

videomap ids fileName

Return all sub-map ids that are described in the videomap file described by fileName. The ids are listed in file order. This command makes possible to iterate through a videomap file one sub-map at a time, to know how much sub-maps are there and to sort them according to their ids.

videomap load fileName index mapInfoName

Load the videomap sub-map located at position index in the file named fileName into a mapinfo object named mapInfoName. It is possible, if needed, to use the videomap ids command to help translate a sub-map id into a sub-map file index.

[front]