ChamplainMarker

ChamplainMarker — A marker to identify points of interest on a map

Synopsis

                    ChamplainMarkerPrivate;
                    ChamplainMarker;
ClutterActor*       champlain_marker_new                (void);
void                champlain_marker_set_position       (ChamplainMarker *marker,
                                                         gdouble longitude,
                                                         gdouble latitude);
ClutterActor*       champlain_marker_new_with_label     (const gchar *label,
                                                         const gchar *font,
                                                         ClutterColor *text_color,
                                                         ClutterColor *marker_color);
ClutterActor*       champlain_marker_new_with_image     (const gchar *filename,
                                                         GError **error);
ClutterActor*       champlain_marker_new_with_image_full
                                                        (const gchar *filename,
                                                         gint width,
                                                         gint height,
                                                         gint anchor_x,
                                                         gint anchor_y,
                                                         GError **error);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----ClutterGroup
                     +----ChamplainMarker

Implemented Interfaces

ChamplainMarker implements ClutterScriptable and ClutterContainer.

Properties

  "latitude"                 gdouble               : Read / Write
  "longitude"                gdouble               : Read / Write

Description

Markers reprensent points of interest on a map. Markers need to be placed on a layer (a ClutterGroup). Layers have to be added to a ChamplainView for the markers to show on the map.

A marker is nothing more than a regular ClutterActor. You can draw on it what ever you want. Don't forget to set the anchor position in the marker using champlain_marker_set_anchor. Set the markers position on the map using champlain_marker_set_position.

Champlain has a default type of markers with text. To create one, use champlain_marker_new_with_label.

Details

ChamplainMarkerPrivate

typedef struct {
  gdouble lon;
  gdouble lat;
} ChamplainMarkerPrivate;


ChamplainMarker

typedef struct _ChamplainMarker ChamplainMarker;


champlain_marker_new ()

ClutterActor*       champlain_marker_new                (void);

Returns :

a new ChamplainMarker ready to be used as a ClutterActor.

Since 0.2


champlain_marker_set_position ()

void                champlain_marker_set_position       (ChamplainMarker *marker,
                                                         gdouble longitude,
                                                         gdouble latitude);

Positions the marker on the map at the coordinates

marker :

a ChamplainMarker

longitude :

the longitude to center the map at

latitude :

the longitude to center the map at

Since 0.2


champlain_marker_new_with_label ()

ClutterActor*       champlain_marker_new_with_label     (const gchar *label,
                                                         const gchar *font,
                                                         ClutterColor *text_color,
                                                         ClutterColor *marker_color);

label :

the text of the label

font :

the font to use to draw the text, for example "Courrier Bold 11", can be NULL

text_color :

a ClutterColor, the color of the text, can be NULL

marker_color :

a ClutterColor, the color of the marker, can be NULL

Returns :

a new ChamplainMarker with a drawn marker containing the given text.

Since 0.2


champlain_marker_new_with_image ()

ClutterActor*       champlain_marker_new_with_image     (const gchar *filename,
                                                         GError **error);

filename :

The filename of the image.

error :

Return location for an error.

Returns :

a new ChamplainMarker with a drawn marker containing the given image.

champlain_marker_new_with_image_full ()

ClutterActor*       champlain_marker_new_with_image_full
                                                        (const gchar *filename,
                                                         gint width,
                                                         gint height,
                                                         gint anchor_x,
                                                         gint anchor_y,
                                                         GError **error);

filename :

The name of an image file to load.

width :

Width of the image in pixel or -1.

height :

Height of the image in pixel or -1.

anchor_x :

X coordinate of the anchor point.

anchor_y :

Y coordinate of the anchor point.

error :

Return location for an error.

Returns :

a new ChamplainMarker with a drawn marker containing the given image.

Property Details

The "latitude" property

  "latitude"                 gdouble               : Read / Write

The latitude coordonate of the map

Allowed values: [-90,90]

Default value: 0

Since 0.2


The "longitude" property

  "longitude"                gdouble               : Read / Write

The longitude coordonate of the map

Allowed values: [-180,180]

Default value: 0

Since 0.2