Marker#

class Marker(**properties: Any)#

Superclasses: Widget, InitiallyUnowned, Object

Subclasses: Point

Implemented Interfaces: Accessible, Buildable, ConstraintTarget, Location

Markers represent points of interest on a map. Markers need to be placed on a layer (a MarkerLayer). Layers have to be added to a Map for the markers to show on the map.

A marker is nothing more than a regular Widget. You can draw on it what ever you want. Set the marker’s position on the map using set_location.

This is a base class of all markers. A typical usage of a marker is for instance to add a Image with a pin image and add the GestureClick controller to listen to click events and show a Popover with the description of the marker.

CSS nodes#

ShumateMarker has a single CSS node with the name “map-marker”.

Constructors#

class Marker
classmethod new() Marker#

Creates an instance of Marker.

Methods#

class Marker
animate_in() None#
animate_in_with_delay(delay: int) None#
Parameters:

delay

animate_out() None#
animate_out_with_delay(delay: int) None#
Parameters:

delay

get_child() Widget | None#

Retrieves the current child of marker.

get_draggable() bool#
get_hotspot() tuple[float, float]#

Get the hotspot point for the given marker. The value is in pixel relative to the top-left corner. Any negative value means that the hotspot get computed with the halign or valign properties.

Added in version 1.5.

get_selectable() bool#

Checks whether the marker is selectable.

is_selected() bool#

Checks whether the marker is selected.

set_child(child: Widget | None = None) None#

Sets the child widget of marker.

Parameters:

child – a Widget

set_draggable(value: bool) None#
Parameters:

value

set_hotspot(x_hotspot: float, y_hotspot: float) None#

Set the hotspot point for the given marker. The value is in pixel relative to the top-left corner. Use any negative value to fallback to the halign or valign properties.

Added in version 1.5.

Parameters:
  • x_hotspot – the x hotspot

  • y_hotspot – the y hotspot

set_selectable(value: bool) None#

Sets the marker as selectable or not.

Parameters:

value – the selectable state

Properties#

class Marker
props.child: Widget#

The child widget of the marker

props.selectable: bool#

The selectable state of the marker

props.x_hotspot: float#

The x hotspot of the marker, a negative value means that the actual x hotspot is calculated with the halign property. The x hotspot should not be more than the width of the widget.

Added in version 1.5.

props.y_hotspot: float#

The y hotspot of the marker, a negative value means that the actual y hotspot is calculated with the valign property. The y hotspot should not be more than the height of the widget.

Added in version 1.5.

Fields#

class Marker
parent_instance#