Shumate.Map¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Animate zoom change when zooming in/out |
||
r/w |
The duration of an animation when going to a location |
||
r |
View’s global state |
||
r |
Viewport |
||
r/w |
Zoom in and recenter on double click on the map |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The |
Fields¶
- Inherited:
Class Details¶
- class Shumate.Map(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The Map widget is a [class`Gtk`.Widget] that show and allows interaction with the user.
This is the base widget and doesn’t have advanced features. You can check the [class`Shumate`.SimpleMap] for a ready-to-use widget.
By default, a [class`Shumate`.Viewport] is created and can be accessed with [method`Shumate`.Map.get_viewport].
Unless created with [ctor`Shumate`.Map.new_simple], the widget doesn’t hold any layer and won’t show anything. A [class`Shumate`.Layer] can be added or removed using the [method`Shumate`.Map.add_layer] or [method`Shumate`.Map.remove_layer] methods.
- classmethod new()¶
- Returns:
a new
Shumate.Map
ready to be used as aGtk.Widget
.- Return type:
Creates an instance of
Shumate.Map
.
- classmethod new_simple()¶
- Return type:
- add_layer(layer)¶
- Parameters:
layer (
Shumate.Layer
) – aShumate.Layer
Adds a new layer to the view
- center_on(latitude, longitude)¶
- Parameters:
Centers the map on these coordinates.
- get_animate_zoom()¶
-
Checks whether the view animates zoom level changes.
- get_go_to_duration()¶
- Returns:
the animation duration when calling [method`Map`.go_to], in milliseconds.
- Return type:
Get the ‘go-to-duration’ property.
- get_state()¶
- Returns:
the state.
- Return type:
Gets the view’s state.
- get_viewport()¶
- Returns:
the
Shumate.Viewport
- Return type:
Get the
Shumate.Viewport
used by this view.
- get_zoom_on_double_click()¶
-
Checks whether the view zooms on double click.
- go_to(latitude, longitude)¶
- Parameters:
Move from the current position to these coordinates. All tiles in the intermediate view WILL be loaded!
- go_to_full(latitude, longitude, zoom_level)¶
- Parameters:
Move from the current position to these coordinates and zoom to the given zoom level. All tiles in the intermediate view WILL be loaded!
- go_to_full_with_duration(latitude, longitude, zoom_level, duration_ms)¶
- Parameters:
Move from the current position to these coordinates and zoom to the given zoom level. The given duration is used instead of the map’s default [property`Map`:py:data::go-to-duration<Shumate.Map.props.go_to_duration>]. All tiles in the intermediate view WILL be loaded!
- insert_layer_above(layer, next_sibling)¶
- Parameters:
layer (
Shumate.Layer
) – aShumate.Layer
next_sibling (
Shumate.Layer
orNone
) – aShumate.Layer
that is a child of self, orNone
Adds layer to self above next_sibling or, if next_sibling is
None
, at the bottom of the layer list.
- insert_layer_behind(layer, next_sibling)¶
- Parameters:
layer (
Shumate.Layer
) – aShumate.Layer
next_sibling (
Shumate.Layer
orNone
) – aShumate.Layer
that is a child of self, orNone
Adds layer to self behind next_sibling or, if next_sibling is
None
, at the top of the layer list.
- remove_layer(layer)¶
- Parameters:
layer (
Shumate.Layer
) – aShumate.Layer
Removes the given layer from the view
- set_animate_zoom(value)¶
-
Should the view animate zoom level changes.
- set_go_to_duration(duration)¶
- Parameters:
duration (
int
) – the animation duration, in milliseconds
Set the duration of the transition of [method`Map`.go_to].
- set_map_source(map_source)¶
- Parameters:
map_source (
Shumate.MapSource
) – aShumate.MapSource
Changes the currently used map source.
GObject.Object.unref
() will be called on the previous one.As a side effect, changing the primary map source will also clear all secondary map sources.
- set_zoom_on_double_click(value)¶
-
Should the view zoom in and recenter when the user double click on the map.
- stop_go_to()¶
Stop the go to animation. The view will stay where it was when the animation was stopped.
- zoom_in()¶
Zooms the map in. If [property`Map`:py:data::animate-zoom<Shumate.Map.props.animate_zoom>] is
TRUE
, the change will be animated.
- zoom_out()¶
Zooms the map out. If [property`Map`:py:data::animate-zoom<Shumate.Map.props.animate_zoom>] is
TRUE
, the change will be animated.
Signal Details¶
- Shumate.Map.signals.animation_completed(map)¶
- Signal Name:
animation-completed
- Flags:
- Parameters:
map (
Shumate.Map
) – The object which received the signal
The
Shumate.Map
::animation-completed
signal is emitted when any animation in the view ends. This is a detailed signal. For example, if you want to be signaled only for go-to animation, you should connect to “animation-completed::go-to”. And for zoom, connect to “animation-completed::zoom”.
Property Details¶
- Shumate.Map.props.animate_zoom¶
-
Animate zoom change when zooming in/out.
- Shumate.Map.props.go_to_duration¶
-
The duration of an animation when going to a location, in milliseconds. A value of 0 means that the duration is calculated automatically for you.
Please note that animation of #shumate_map_ensure_visible also involves a ‘go-to’ animation.
- Shumate.Map.props.state¶
- Name:
state
- Type:
- Default Value:
- Flags:
The view’s global state. Useful to inform using if the view is busy loading tiles or not.
- Shumate.Map.props.viewport¶
- Name:
viewport
- Type:
- Default Value:
- Flags:
The viewport, which contains information about the center, rotation, zoom, etc. of the map.