HERE Android SDK Developer's Guide

MapScreenMarker

The class MapScreenMarker is a member of com.here.android.mpa.mapping .

Class Summary

public final class MapScreenMarker

extends com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject, java.lang.Object

Represents a marker used to display an icon at a screen position on a map.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in MapScreenMarker
Constructors

MapScreenMarker ()

Default constructor.

MapScreenMarker (PointF position, Image icon)

Constructor

Method Summary

Table 2. Methods in MapScreenMarker
Methods

public PointF getAnchorPoint ()

Gets the anchor point for the MapScreenMarker .

public Image getIcon ()

Gets the icon image for the MapScreenMarker .

public PointF getScreenCoordinate ()

Gets the screen location of the MapScreenMarker .

public float getTransparency ()

Gets the current transparency level of the MapScreenMarker .

public MapScreenMarker setAnchorPoint (PointF anchor)

Sets an anchor point for the MapScreenMarker .

public MapScreenMarker setIcon (Image icon)

Sets an icon image for the MapScreenMarker .

public MapScreenMarker setScreenCoordinate (PointF position)

Sets the screen location of the MapScreenMarker .

public MapScreenMarker setTransparency (float alpha)

Sets a transparency level, within the range of [0..1], for the MapScreenMarker .

Class Details

Represents a marker used to display an icon at a screen position on a map. The marker stays at its screen location regardless of map movements such as panning and rotation.

MapScreenMarker are selectable MapObjects.

Constructor Details

MapScreenMarker ()

Default constructor. Call setIcon(Image) and setAnchorPoint(PointF) to place the marker.

MapScreenMarker (PointF position, Image icon)

Constructor

Parameters:

  • position

    Anchor position MapScreenMarker#setAnchorPoint(PointF)

  • icon

    An Image representing the icon. MapScreenMarker#setIcon(Image)

Method Details

public PointF getAnchorPoint ()

Gets the anchor point for the MapScreenMarker .

By default, the MapScreenMarker is anchored at the center of the icon image.

Returns:

A PointF representing the anchor point of the MapScreenMarker.

public Image getIcon ()

Gets the icon image for the MapScreenMarker .

Returns:

An Image representing the icon.

public PointF getScreenCoordinate ()

Gets the screen location of the MapScreenMarker .

Returns:

A PointF representing the screen location of the marker.

public float getTransparency ()

Gets the current transparency level of the MapScreenMarker .

The transparency level is only precise to two decimal places due to numerical operations performed internally when rendering the map.

Returns:

The current transparency level of the MapScreenMarker.

public MapScreenMarker setAnchorPoint (PointF anchor)

Sets an anchor point for the MapScreenMarker .

The marker is drawn with the specified pixel offset from its getScreenCoordinate() position. To clear an anchor set previously, pass a PointF to this method with an X-coordinate equal to half the width of the marker and a Y-coordinate equal to half the height of the marker.

By default, the MapScreenMarker is anchored at the center of the icon image.

Parameters:

  • anchor

    A PointF representing the anchor point of the MapScreenMarker.

Returns:

The updated MapScreenMarker itself.

public MapScreenMarker setIcon (Image icon)

Sets an icon image for the MapScreenMarker .

Parameters:

  • icon

    An Image representing the icon.

public MapScreenMarker setScreenCoordinate (PointF position)

Sets the screen location of the MapScreenMarker .

Parameters:

  • position

    A PointF

Returns:

The updated MapScreenMarker itself.

public MapScreenMarker setTransparency (float alpha)

Sets a transparency level, within the range of [0..1], for the MapScreenMarker .

Parameters:

  • alpha

    Desired alpha value for the MapScreenMarker, 0 for fully transparent, 1 for fully opaque. Default value is 1.

Returns:

The modified MapScreenMarker itself.

Throws:

  • IllegalArgumentException

    if alpha is not within the range [0..1]

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.