Marker#
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#
Methods#
- class Marker
-
- 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
halignorvalignproperties.Added in version 1.5.
- set_child(child: Widget | None = None) None#
Sets the child widget of
marker.- Parameters:
child – a
Widget
- 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
halignorvalignproperties.Added in version 1.5.
- Parameters:
x_hotspot – the x hotspot
y_hotspot – the y hotspot
Properties#
Fields#
- class Marker
- parent_instance#