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.
CSS nodes
`ShumateMap` has a single CSS node with the name “map-view”.
- public void add_layer (Layer layer)
Adds a new layer to the view
- public void center_on (double latitude, double longitude)
Centers the map on these coordinates.
- public bool get_animate_zoom ()
Checks whether the view animates zoom level changes.
- public uint get_go_to_duration ()
Get the 'go-to-duration' property.
- public State get_state ()
Gets the view's state.
- public unowned Viewport get_viewport ()
- public bool get_zoom_on_double_click ()
Checks whether the view zooms on double click.
- public void go_to (double latitude, double longitude)
Move from the current position to these coordinates.
- public void go_to_full (double latitude, double longitude, double zoom_level)
Move from the current position to these coordinates and zoom to the
given zoom level.
- public void go_to_full_with_duration (double latitude, double longitude, double zoom_level, uint duration_ms)
Move from the current position to these coordinates and zoom to the
given zoom level.
- public void insert_layer_above (Layer layer, Layer? next_sibling)
Adds layer to this
above next_sibling or, if next_sibling is null, at the bottom of the layer
list.
- public void insert_layer_behind (Layer layer, Layer? next_sibling)
Adds layer to this
behind next_sibling or, if next_sibling is null, at the top of the layer
list.
- public void remove_layer (Layer layer)
Removes the given layer from the view
- public void set_animate_zoom (bool value)
Should the view animate zoom level changes.
- public void set_go_to_duration (uint duration)
Set the duration of the transition of [method@Map.
- public void set_map_source (MapSource map_source)
Changes the currently used map source.
- public void set_zoom_on_double_click (bool value)
Should the view zoom in and recenter when the user double click on the
map.
- public void stop_go_to ()
Stop the go to animation.
- public void zoom_in ()
Zooms the map in.
- public void zoom_out ()
Zooms the map out.