OsmGpsMap.MapLayer

g GObject.GInterface GObject.GInterface OsmGpsMap.MapLayer OsmGpsMap.MapLayer GObject.GInterface->OsmGpsMap.MapLayer

Implementations:

OsmGpsMap.MapOsd

Methods

busy ()

button_press (map, event)

draw (map, cr)

render (map)

Virtual Methods

do_busy ()

do_button_press (map, event)

do_draw (map, cr)

do_render (map)

Properties

None

Signals

None

Fields

None

Class Details

class OsmGpsMap.MapLayer
Bases:

GObject.GInterface

Structure:

OsmGpsMap.MapLayerIface

busy()
Returns:

layer busy state

Return type:

bool

Check whether layer is busy (eg drawing an animation)

Added in version 0.6.0.

button_press(map, event)
Parameters:
Returns:

whether the event had been handled

Return type:

bool

Handle button event

Added in version 0.6.0.

draw(map, cr)
Parameters:

During Gtk.Widget ::draw the map passes its cairo context here. Draw in widget pixel coordinates. Convert geographic positions with OsmGpsMap.Map.convert_geographic_to_screen(). Do not create your own cairo surface; the map already has one. For GPS tracks and markers prefer OsmGpsMap.Map.track_add() and OsmGpsMap.Map.image_add().

Added in version 0.6.0.

render(map)
Parameters:

map (OsmGpsMap.Map) – a OsmGpsMap.Map widget

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

Added in version 0.6.0.

do_busy() virtual
Returns:

layer busy state

Return type:

bool

Check whether layer is busy (eg drawing an animation)

Added in version 0.6.0.

do_button_press(map, event) virtual
Parameters:
Returns:

whether the event had been handled

Return type:

bool

Handle button event

Added in version 0.6.0.

do_draw(map, cr) virtual
Parameters:

During Gtk.Widget ::draw the map passes its cairo context here. Draw in widget pixel coordinates. Convert geographic positions with OsmGpsMap.Map.convert_geographic_to_screen(). Do not create your own cairo surface; the map already has one. For GPS tracks and markers prefer OsmGpsMap.Map.track_add() and OsmGpsMap.Map.image_add().

Added in version 0.6.0.

do_render(map) virtual
Parameters:

map (OsmGpsMap.Map) – a OsmGpsMap.Map widget

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

Added in version 0.6.0.