Shumate.Viewport

g GObject.GInterface GObject.GInterface Shumate.Location Shumate.Location GObject.GInterface->Shumate.Location GObject.Object GObject.Object Shumate.Viewport Shumate.Viewport GObject.Object->Shumate.Viewport Shumate.Location->Shumate.Viewport

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Shumate.Location (4)

Structs:

GObject.ObjectClass (5)

class

new ()

get_max_zoom_level ()

get_min_zoom_level ()

get_reference_map_source ()

get_rotation ()

get_zoom_level ()

location_to_widget_coords (widget, latitude, longitude)

set_max_zoom_level (max_zoom_level)

set_min_zoom_level (min_zoom_level)

set_reference_map_source (map_source)

set_rotation (rotation)

set_zoom_level (zoom_level)

widget_coords_to_location (widget, x, y)

Virtual Methods

Inherited:

GObject.Object (7), Shumate.Location (3)

Properties

Inherited:

Shumate.Location (2)

Name

Type

Flags

Short Description

max-zoom-level

int

r/w/en

The highest allowed level of zoom

min-zoom-level

int

r/w/en

The lowest allowed level of zoom

reference-map-source

Shumate.MapSource

r/w/en

The reference map source being displayed

rotation

float

r/w/en

The rotation of the map view in radians

zoom-level

float

r/w/en

The level of zoom of the map

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Shumate.Viewport(**kwargs)
Bases:

GObject.Object, Shumate.Location

Abstract:

No

Structure:

Shumate.ViewportClass

The object holding the coordinate, zoom-level, and rotation state of the current view.

As the object implements [iface`Shumate`.Location], the latitude and longitude are accessible via the interface methods.

classmethod new()
Returns:

A new Shumate.Viewport

Return type:

Shumate.Viewport

Creates a new Shumate.Viewport

get_max_zoom_level()
Returns:

the maximal zoom level

Return type:

int

Get the maximal zoom level

get_min_zoom_level()
Returns:

the minimal zoom level

Return type:

int

Get the minimal zoom level

get_reference_map_source()
Returns:

the reference Shumate.MapSource or None when none has been set.

Return type:

Shumate.MapSource or None

Get the reference map source

get_rotation()
Returns:

the current rotation

Return type:

float

Gets the current rotation

get_zoom_level()
Returns:

the current zoom level

Return type:

float

Get the current zoom level

location_to_widget_coords(widget, latitude, longitude)
Parameters:
Returns:

x:

return value for the x coordinate

y:

return value for the y coordinate

Return type:

(x: float, y: float)

Gets the position on widget that correspond to the given latitude and longitude.

set_max_zoom_level(max_zoom_level)
Parameters:

max_zoom_level (int) – the maximal zoom level

Set the maximal zoom level

set_min_zoom_level(min_zoom_level)
Parameters:

min_zoom_level (int) – the minimal zoom level

Set the minimal zoom level

set_reference_map_source(map_source)
Parameters:

map_source (Shumate.MapSource or None) – a Shumate.MapSource or None to set none.

Set the reference map source

set_rotation(rotation)
Parameters:

rotation (float) – the rotation

Sets the rotation

set_zoom_level(zoom_level)
Parameters:

zoom_level (float) – the zoom level

Set the zoom level

widget_coords_to_location(widget, x, y)
Parameters:
Returns:

latitude:

return location for the latitude

longitude:

return location for the longitude

Return type:

(latitude: float, longitude: float)

Gets the latitude and longitude corresponding to a position on widget.

Property Details

Shumate.Viewport.props.max_zoom_level
Name:

max-zoom-level

Type:

int

Default Value:

20

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The highest allowed level of zoom of the content.

Shumate.Viewport.props.min_zoom_level
Name:

min-zoom-level

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The lowest allowed level of zoom of the content.

Shumate.Viewport.props.reference_map_source
Name:

reference-map-source

Type:

Shumate.MapSource

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The reference Shumate.MapSource being displayed

Shumate.Viewport.props.rotation
Name:

rotation

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The rotation of the map view, in radians clockwise from up being due north

Shumate.Viewport.props.zoom_level
Name:

zoom-level

Type:

float

Default Value:

3.0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The level of zoom of the content.