ChamplainMarker

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

Synopsis


#include <champlain/champlainmarker.h>

                    ChamplainMarker;
ClutterActor*       champlain_marker_new                ();
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);
void                champlain_marker_set_position       (ChamplainMarker *marker,
                                                         gdouble longitude,
                                                         gdouble latitude);

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

ChamplainMarker

typedef struct {
  ClutterGroup group;

  ChamplainMarkerPrivate *priv;
} ChamplainMarker;


champlain_marker_new ()

ClutterActor*       champlain_marker_new                ();

Returns :

a new ChamplainMarker ready to be used as a ClutterActor.

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.

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