SimpleMap

class SimpleMap(**properties: Any)

Superclasses: Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, Buildable, ConstraintTarget

A ready-to-use map Widget.If you want to use your own implementation, you can look at the Map widget.

The simple map contains a zoom widget, a License at the bottom, a Scale and a Compass.

Constructors

class SimpleMap
classmethod new() SimpleMap

Methods

class SimpleMap
add_overlay_layer(layer: Layer) None

Adds a map layer as an overlay on top of the base map.

Parameters:

layer – a Layer to add

get_compass() Compass

Gets the compass widget for the map.

get_license() License

Gets the license widget for the map.

get_map() Map

Gets the SimpleMap’s underlying Map.

get_map_source() MapSource

Gets the map source for the current base layer.

get_scale() Scale

Gets the scale widget for the map.

get_show_zoom_buttons() bool

Gets whether or not the zoom buttons are shown.

get_viewport() Viewport

Gets the map’s viewport, needed for constructing map layers that will be added to it.

insert_overlay_layer(layer: Layer, idx: int) None
Parameters:
  • layer

  • idx

remove_overlay_layer(layer: Layer) None

Removes a layer from the map.

Parameters:

layer – a Layer that was added to the map previously

set_map_source(map_source: MapSource | None = None) None

Sets the source for the base map.

Parameters:

map_source – a MapSource

set_show_zoom_buttons(show_zoom_buttons: bool) None

Sets whether or not the zoom buttons are shown.

Parameters:

show_zoom_buttonsTrue to show the zoom buttons, False to hide them

Properties

class SimpleMap
props.compass: Compass
props.license: License
props.map: Map
props.map_source: MapSource
props.scale: Scale
props.show_zoom_buttons: bool
props.viewport: Viewport

Signals

class SimpleMap.signals
symbol_clicked(event: SymbolEvent) None

Emitted when a symbol in the base map layer (not in overlay layers) is clicked.

Added in version 1.1.

Parameters:

event – a SymbolEvent with details about the clicked symbol.