Class: Toybox.WatchUi.MapMarker

Overview

The base class for the MapMarker object.

The MapMarker is used to hold a BitmapResource, or a MAP_MARKER_ICON_* enum value, and the corresponding x, y value to note the "hotspot" for the image to be used as an icon for a marker within a MapView. This class also contains the Location at which the MapMarker should be displayed on the map.

Since:

API Level 3.0.0

Supported Devices:

Instance Method Summary collapse

Instance Method Details

getLocation() as Position.Location

Get the location for the MapMarker.

Returns:

Since:

API Level 3.0.0

initialize(location as Position.Location)

Constructor

Parameters:

  • location(Position.Location)

    The Location at which the MapMarker object will be rendered on the map

Since:

API Level 3.0.0

Throws:

setIcon(icon as Graphics.BitmapType or WatchUi.MapMarkerIcon or Lang.Number, x as Lang.Number, y as Lang.Number) as Void

Set a bitmap icon to use for the MapMarker object on a MapView.

Parameters:

  • icon(Graphics.BitmapType, Lang.Number)

    A BitmapType or MAP_MARKER_ICON_* value

  • x(Lang.Number)

    The x location of the hotspot on the bitmap in pixels (px). Used to align the hotspot with the longitude of the MapMarker. This value is required, but will be disregarded when used with MAP_MARKER_ICON_* type.

  • y(Lang.Number)

    The y location of the hotspot on the bitmap in pixels (px). Used to align the hotspot with the latitude value of the MapMarker. This value is required, but will be disregarded when used with MAP_MARKER_ICON_* type.

Since:

API Level 3.0.0

Throws:

setLabel(label as Lang.String or Lang.ResourceId) as Void

Parameters:

See Also:

Since:

API Level 3.0.0


Generated Apr 17, 2024 9:40:39 AM