OsmGpsMapTrack: OsmGpsMap Reference Manual

## OsmGpsMapTrack OsmGpsMapTrack — A list of GPS points |

## Stability Level

Stable, unless otherwise indicated

## Functions

void | osm_gps_map_track_add_point ()
void | osm_gps_map_track_get_color ()
GSList * | osm_gps_map_track_get_points ()
double | osm_gps_map_track_get_length ()
OsmGpsMapPoint * | osm_gps_map_track_get_point ()
void | osm_gps_map_track_insert_point ()
int | osm_gps_map_track_n_points ()
void | osm_gps_map_track_remove_point ()
void | osm_gps_map_track_set_color ()
OsmGpsMapTrack * | osm_gps_map_track_new ()

## Properties

gfloat | alpha | Read / Write / Construct
GdkRGBA * | color | Read / Write
gboolean | editable | Read / Write / Construct
gfloat | line-width | Read / Write / Construct
gpointer | track | Read / Write / Construct Only
gboolean | visible | Read / Write / Construct

## Signals

void | point-added | Run First
void | point-changed | Run First
void | point-inserted | Run First
void | point-removed | Run First

## Types and Values

struct | OsmGpsMapTrack
struct | OsmGpsMapTrackClass

## Object Hierarchy

        GObject
        ╰── OsmGpsMapTrack

## Includes

    #include <osm-gps-map.h>

## Description

OsmGpsMapTrack stores multiple OsmGpsMapPoint objects, i.e. a track, and describes how such a track should be drawn on the map (see `osm_gps_map_track_add()`), including its colour, width, etc.

## Functions

### osm_gps_map_track_add_point ()

    void
    osm_gps_map_track_add_point (OsmGpsMapTrack *track,
                                 const OsmGpsMapPoint *point);

Add a point to track

#### Parameters

track | a OsmGpsMapTrack. | [inout]
point | a OsmGpsMapPoint point to add. | [in]

Since: 0.7.0

### osm_gps_map_track_get_color ()

    void
    osm_gps_map_track_get_color (OsmGpsMapTrack *track,
                                 GdkRGBA *color);

Get track color

#### Parameters

track | a OsmGpsMapTrack. | [in]
color | track color. | [out caller-allocates]

Since: 0.7.0

### osm_gps_map_track_get_points ()

    GSList *
    osm_gps_map_track_get_points (OsmGpsMapTrack *track);

Get list of points in the track

#### Parameters

track | a OsmGpsMapTrack. | [in]

#### Returns

list of OsmGpsMapPoint.

[element-type OsmGpsMapPoint][transfer none]

Since: 0.7.0

### osm_gps_map_track_get_length ()

    double
    osm_gps_map_track_get_length (OsmGpsMapTrack *track);

Get track length in meters

#### Parameters

track | a OsmGpsMapTrack. | [in]

#### Returns

the length of the track in meters.

Since: 1.1.0

### osm_gps_map_track_get_point ()

    OsmGpsMapPoint *
    osm_gps_map_track_get_point (OsmGpsMapTrack *track,
                                 int pos);

Get a OsmGpsMapPoint point at `pos` of given track

#### Parameters

track | a OsmGpsMapTrack |
pos | Position of the point to get |

#### Returns

a OsmGpsMapPoint.

[transfer none]

Since: 1.1.0

### osm_gps_map_track_insert_point ()

    void
    osm_gps_map_track_insert_point (OsmGpsMapTrack *track,
                                    OsmGpsMapPoint *np,
                                    int pos);

Instert point `np` at given postition `pos`

#### Parameters

track | a OsmGpsMapTrack |
np | a OsmGpsMapPoint |
pos | Position for the point |

Since: 1.1.0

### osm_gps_map_track_n_points ()

    int
    osm_gps_map_track_n_points (OsmGpsMapTrack *track);

Get number of points in the track

#### Parameters

track | a OsmGpsMapTrack |

#### Returns

the number of points in the track.

Since: 1.1.0

### osm_gps_map_track_remove_point ()

    void
    osm_gps_map_track_remove_point (OsmGpsMapTrack *track,
                                    int pos);

Remove track point at `pos` position in point list

#### Parameters

track | a OsmGpsMapTrack. | [in]
pos | Position of the point to remove |

Since: 1.1.0

### osm_gps_map_track_set_color ()

    void
    osm_gps_map_track_set_color (OsmGpsMapTrack *track,
                                 GdkRGBA *color);

Set track color

#### Parameters

track | a OsmGpsMapTrack. | [in]
color | new track color. | [in]

Since: 1.1.0

### osm_gps_map_track_new ()

    OsmGpsMapTrack *
    osm_gps_map_track_new (void);

Create new track

#### Returns

New track.

[transfer full]

Since: 0.7.0

## Types and Values

### struct OsmGpsMapTrack

    struct OsmGpsMapTrack;

### struct OsmGpsMapTrackClass

    struct OsmGpsMapTrackClass {
        GObjectClass parent_class;
    };

## Property Details

### The `“alpha”` property

      “alpha”                    gfloat

alpha transparency of the track.

Owner: OsmGpsMapTrack

Flags: Read / Write / Construct

Allowed values: [0,1]

Default value: 0.6

### The `“color”` property

      “color”                    GdkRGBA *

color of the track.

Owner: OsmGpsMapTrack

Flags: Read / Write

### The `“editable”` property

      “editable”                 gboolean

should this track be editable.

Owner: OsmGpsMapTrack

Flags: Read / Write / Construct

Default value: FALSE

### The `“line-width”` property

      “line-width”               gfloat

width of the lines drawn for the track.

Owner: OsmGpsMapTrack

Flags: Read / Write / Construct

Allowed values: [0,100]

Default value: 4

### The `“track”` property

      “track”                    gpointer

list of points for the track.

Owner: OsmGpsMapTrack

Flags: Read / Write / Construct Only

### The `“visible”` property

      “visible”                  gboolean

should this track be visible.

Owner: OsmGpsMapTrack

Flags: Read / Write / Construct

Default value: TRUE

## Signal Details

### The `“point-added”` signal

    void
    user_function (OsmGpsMapTrack *self,
                   OsmGpsMapPoint *arg1,
                   gpointer        user_data)

The “point-added” signal is emitted whenever a OsmGpsMapPoint is added to the OsmGpsMapTrack.

#### Parameters

self | A OsmGpsMapTrack |
arg1 | The added OsmGpsMapPoint |
user_data | user data set when the signal handler was connected. |

Flags: Run First

### The `“point-changed”` signal

    void
    user_function (OsmGpsMapTrack *osmgpsmaptrack,
                   gint            arg1,
                   gpointer        user_data)

Flags: Run First

### The `“point-inserted”` signal

    void
    user_function (OsmGpsMapTrack *osmgpsmaptrack,
                   gint            arg1,
                   gpointer        user_data)

Flags: Run First

### The `“point-removed”` signal

    void
    user_function (OsmGpsMapTrack *osmgpsmaptrack,
                   gint            arg1,
                   gpointer        user_data)

Flags: Run First