Shumate.Viewport¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
The highest allowed level of zoom |
||
r/w/en |
The lowest allowed level of zoom |
||
r/w/en |
The reference map source being displayed |
||
r/w/en |
The rotation of the map view in radians |
||
r/w/en |
The level of zoom of the map |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Shumate.Viewport(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
Creates a new
Shumate.Viewport
- get_reference_map_source()¶
- Returns:
the reference
Shumate.MapSource
orNone
when none has been set.- Return type:
Get the reference map source
- location_to_widget_coords(widget, latitude, longitude)¶
- Parameters:
widget (
Gtk.Widget
) – aGtk.Widget
that uses self as viewportlatitude (
float
) – the latitudelongitude (
float
) – the longitude
- Returns:
- x:
return value for the x coordinate
- y:
return value for the y coordinate
- Return type:
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
orNone
) – aShumate.MapSource
orNone
to set none.
Set the reference map source
- widget_coords_to_location(widget, x, y)¶
- Parameters:
widget (
Gtk.Widget
) – aGtk.Widget
that uses self as viewportx (
float
) – the x coordinatey (
float
) – the y coordinate
- Returns:
- latitude:
return location for the latitude
- longitude:
return location for the longitude
- Return type:
Gets the latitude and longitude corresponding to a position on widget.
Property Details¶
- Shumate.Viewport.props.max_zoom_level¶
- Name:
max-zoom-level
- Type:
- Default Value:
20
- Flags:
The highest allowed level of zoom of the content.
- Shumate.Viewport.props.min_zoom_level¶
- Name:
min-zoom-level
- Type:
- Default Value:
0
- Flags:
The lowest allowed level of zoom of the content.
- Shumate.Viewport.props.reference_map_source¶
- Name:
reference-map-source
- Type:
- Default Value:
- Flags:
The reference
Shumate.MapSource
being displayed
- Shumate.Viewport.props.rotation¶
- Name:
rotation
- Type:
- Default Value:
0.0
- Flags:
The rotation of the map view, in radians clockwise from up being due north
- Shumate.Viewport.props.zoom_level¶
- Name:
zoom-level
- Type:
- Default Value:
3.0
- Flags:
The level of zoom of the content.