OsmGpsMapLayer

OsmGpsMapLayer — An interface for layers to be drawn on the map

Stability Level

Stable, unless otherwise indicated

Functions

Properties

guint dpad-radius Read / Write / Construct
int osd-x Read / Write / Construct
int osd-y Read / Write / Construct
gboolean show-coordinates Read / Write / Construct
gboolean show-copyright Read / Write / Construct
gboolean show-crosshair Read / Write / Construct
gboolean show-dpad Read / Write / Construct
gboolean show-gps-in-dpad Read / Write / Construct
gboolean show-gps-in-zoom Read / Write / Construct
gboolean show-scale Read / Write / Construct
gboolean show-zoom Read / Write / Construct

Types and Values

Object Hierarchy

    GInterface
    ╰── OsmGpsMapLayer
    GObject
    ╰── OsmGpsMapOsd

Implemented Interfaces

OsmGpsMapOsd implements OsmGpsMapLayer.

Known Implementations

OsmGpsMapLayer is implemented by OsmGpsMapOsd.

Includes

#include <osm-gps-map.h>

Description

OsmGpsMapLayer is an interface implemented by objects that wish to draw on top of the map and respond to button press events. The most common implementation of this interface is OsmGpsMapOsd.

The map already provides a cairo context in osm_gps_map_layer_draw(). Convert lat/lon to widget pixels with osm_gps_map_convert_geographic_to_screen(). See DrawLayer in examples/mapviewer.py and examples/mapviewer.c. For tracks and images use osm_gps_map_track_add() and osm_gps_map_image_add() instead of a custom layer.

Functions

osm_gps_map_layer_render ()

void
osm_gps_map_layer_render (OsmGpsMapLayer *self,
                          OsmGpsMap *map);

Called when the offscreen map pixmap is rebuilt. Use this to update cached drawing (as OsmGpsMapOsd does). Geographic overlays can leave this empty and paint in osm_gps_map_layer_draw() instead.

Parameters

self

a OsmGpsMapLayer object.

[in]

map

a OsmGpsMap widget.

[in]

Since: 0.6.0


osm_gps_map_layer_draw ()

void
osm_gps_map_layer_draw (OsmGpsMapLayer *self,
                        OsmGpsMap *map,
                        cairo_t *cr);

During “draw” the map passes its cairo context here. Draw in widget pixel coordinates. Convert geographic positions with osm_gps_map_convert_geographic_to_screen(). Do not create your own cairo surface; the map already has one. For GPS tracks and markers prefer osm_gps_map_track_add() and osm_gps_map_image_add().

Parameters

self

a OsmGpsMapLayer object.

[in]

map

a OsmGpsMap widget.

[in]

cr

a cairo context to draw to.

[in]

Since: 0.6.0


osm_gps_map_layer_busy ()

gboolean
osm_gps_map_layer_busy (OsmGpsMapLayer *self);

Check whether layer is busy (eg drawing an animation)

Parameters

self

a OsmGpsMapLayer object.

[in]

Returns

layer busy state

Since: 0.6.0


osm_gps_map_layer_button_press ()

gboolean
osm_gps_map_layer_button_press (OsmGpsMapLayer *self,
                                OsmGpsMap *map,
                                GdkEventButton *event);

Handle button event

Parameters

self

a OsmGpsMapLayer object.

[in]

map

a OsmGpsMap widget.

[in]

event

a GdkEventButton event.

[in]

Returns

whether the event had been handled

Since: 0.6.0


osm_gps_map_osd_new ()

OsmGpsMapOsd *
osm_gps_map_osd_new (void);

Creates a new instance of OsmGpsMapOsd.

Returns

the newly created OsmGpsMapOsd instance

Types and Values

OsmGpsMapLayer

typedef struct _OsmGpsMapLayer OsmGpsMapLayer;

struct OsmGpsMapOsd

struct OsmGpsMapOsd;

struct OsmGpsMapOsdClass

struct OsmGpsMapOsdClass {
	GObjectClass parent_class;

	/* vtable */
};

Property Details

The “dpad-radius” property

  “dpad-radius”              guint

The dpad radius property.

Owner: OsmGpsMapOsd

Flags: Read / Write / Construct

Default value: 30


The “osd-x” property

  “osd-x”                    int

The osd x property.

Owner: OsmGpsMapOsd

Flags: Read / Write / Construct

Default value: 10


The “osd-y” property

  “osd-y”                    int

The osd y property.

Owner: OsmGpsMapOsd

Flags: Read / Write / Construct

Default value: 10


The “show-coordinates” property

  “show-coordinates”         gboolean

The show coordinates of map centre property.

Owner: OsmGpsMapOsd

Flags: Read / Write / Construct

Default value: TRUE


The “show-copyright” property

  “show-copyright”           gboolean

The show copyright property.

Owner: OsmGpsMapOsd

Flags: Read / Write / Construct

Default value: TRUE

Since: 1.2.0


The “show-crosshair” property

  “show-crosshair”           gboolean

The show crosshair at map centre property.

Owner: OsmGpsMapOsd

Flags: Read / Write / Construct

Default value: FALSE


The “show-dpad” property

  “show-dpad”                gboolean

The show dpad for map navigation property.

Owner: OsmGpsMapOsd

Flags: Read / Write / Construct

Default value: FALSE


The “show-gps-in-dpad” property

  “show-gps-in-dpad”         gboolean

The show gps indicator in middle of dpad property.

Owner: OsmGpsMapOsd

Flags: Read / Write / Construct

Default value: FALSE


The “show-gps-in-zoom” property

  “show-gps-in-zoom”         gboolean

The show gps indicator in middle of zoom control property.

Owner: OsmGpsMapOsd

Flags: Read / Write / Construct

Default value: FALSE


The “show-scale” property

  “show-scale”               gboolean

The show scale on the map property.

Owner: OsmGpsMapOsd

Flags: Read / Write / Construct

Default value: TRUE


The “show-zoom” property

  “show-zoom”                gboolean

The show zoom control for map navigation property.

Owner: OsmGpsMapOsd

Flags: Read / Write / Construct

Default value: FALSE