Class
ShumateMap
Description [src]
class Shumate.Map : Gtk.Widget {
parent_instance: GtkWidget
}
A GtkWidget
to display maps. It supports two modes of scrolling:
- Push: the normal behavior where the maps don’t move after the user stopped scrolling;
- Kinetic: the behavior where the maps decelerate after the user stopped scrolling.
The maps are downloaded from Internet from open maps sources (like
OpenStreetMap). Maps are divided
in tiles for each zoom level. When a tile is requested, ShumateMap
will
first check if it is in cache (in the user’s cache dir under shumate). If
an error occurs during download, an error tile will be displayed.
Constructors
shumate_map_new
Creates an instance of ShumateMap
.
shumate_map_new_simple
Instance methods
shumate_map_add_layer
Adds a new layer to the view.
shumate_map_center_on
Centers the map on these coordinates.
shumate_map_get_animate_zoom
Checks whether the view animates zoom level changes.
shumate_map_get_go_to_duration
Get the ‘go-to-duration’ property.
shumate_map_get_state
Gets the view’s state.
shumate_map_get_viewport
Get the ShumateViewport
used by this view.
shumate_map_get_zoom_on_double_click
Checks whether the view zooms on double click.
shumate_map_go_to
Move from the current position to these coordinates. All tiles in the intermediate view WILL be loaded!
shumate_map_insert_layer_above
Adds layer
to self
above next_sibling
or, if next_sibling
is NULL
, at
the bottom of the layer list.
shumate_map_insert_layer_behind
Adds layer
to self
behind next_sibling
or, if next_sibling
is NULL
, at
the top of the layer list.
shumate_map_remove_layer
Removes the given layer from the view.
shumate_map_set_animate_zoom
Should the view animate zoom level changes.
shumate_map_set_go_to_duration
Set the duration of the transition of shumate_map_go_to()
.
shumate_map_set_map_source
Changes the currently used map source. #g_object_unref()
will be called on
the previous one.
shumate_map_set_zoom_on_double_click
Should the view zoom in and recenter when the user double click on the map.
shumate_map_stop_go_to
Stop the go to animation. The view will stay where it was when the animation was stopped.
Properties
Shumate.Map:animate-zoom
Animate zoom change when zooming in/out.
Shumate.Map: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.
Shumate.Map:state
The view’s global state. Useful to inform using if the view is busy loading tiles or not.
Shumate.Map:viewport
The viewport, which contains information about the center, rotation, zoom, etc. of the map.
Shumate.Map:zoom-on-double-click
Should the view zoom in and recenter when the user double click on the map.
Signals
Shumate.Map::animation-completed
The ShumateMap::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”.