Marker

Since: BlackBerry 10.0.0

#include <bb/platform/geo/Marker>

To link against this class, add the following line to your .pro file: LIBS += -lbbcascadesmaps

A visual representation of a location on a map.

Markers are designed to indicate a location's position. Examples of markers include push pins, arrows, or bullseyes. A marker is a fixed image: when the map is zoomed in or out, the marker stays the same screen size.

Markers are defined by the following properties:
  • icon URI: the location of the icon image

  • icon size: the pixel dimensions of the icon image at the icon URI. Note that this is not used to scale the image.

  • location coordinates: the coordinates within the icon image that is positioned at the actual location on the map

  • caption coordinates: the coordinates within the icon image that the caption bubble tail points to


Overview

Public Functions Index

Marker ()
Marker (const QString &iconUri, const QSize &iconSize, const QPoint &locCoord, const QPoint &captionCoord)
Marker (const Marker &src)
~Marker ()
QStringabsoluteIconPath () const
QPointcaptionTailCoordinate () const
QSizeiconSize () const
QStringiconUri () const
QPointlocationCoordinate () const
booloperator!= (const Marker &rhs) const
Marker &operator= (const Marker &src)
booloperator== (const Marker &rhs) const
voidsetCaptionTailCoordinate (const QPoint &captionCoord)
voidsetIconSize (const QSize &iconSize)
voidsetIconUri (const QString &uri)
voidsetLocationCoordinate (const QPoint &locCoord)

Public Functions

Marker ()

Creates a Marker instance.

Since:

BlackBerry 10.0.0

Marker (

Creates a Marker instance.

Parameters
iconUri

The URI of the marker's icon. See setIconUri.

iconSize

The size of the marker's icon. See setIconSize.

locCoord

The coordinates within the icon to position over the actual location. See setLocationCoordinate.

captionCoord

The coordinates within the icon that the tail of the focus caption bubble points to. See setCaptionTailCoordinate.

Since:

BlackBerry 10.0.0

Marker (

Copy constructor.

Parameters
src

The object from which to copy information.

Since:

BlackBerry 10.0.0

~Marker ()

Destructor.

Since:

BlackBerry 10.0.0

QString absoluteIconPath ()

Returns the absolute path to the icon stated in setIconUri.

This operation returns an absolute path to the icon's location using a POSIX format. Thus, any "file://" or "asset:///" protocols have been resolved to local paths, and relative paths have been resolved.

This is a read-only property set through setIconUri().

Return:

The absolute path to the icon.

Since:

BlackBerry 10.2.0

QPoint captionTailCoordinate ()

The coordinates within the marker where the caption bubble's tail should point to.

Return:

The point within the icon where the caption bubble can safely point to.

Since:

BlackBerry 10.0.0

QSize iconSize ()

The size of the marker's icon.

Return:

The marker's icon size.

Since:

BlackBerry 10.0.0

QString iconUri ()

Returns the URI to the icon.

Return:

The URI to the icon, as set in setIconUri().

Since:

BlackBerry 10.0.0

QPoint locationCoordinate ()

The coordinates within the marker that overlay the actual location.

Examples include the point of a push-pin, the center of a bullseye, or the head of an arrow.

Return:

The coordinates within the marker that represent the location.

Since:

BlackBerry 10.0.0

bool operator!= (

Inequality operator.

Return:

true if any property is different.

Since:

BlackBerry 10.0.0

Marker & operator= (

Assignment operator.

Parameters
src

The object from which to copy information.

Since:

BlackBerry 10.0.0

bool operator== (

Equality operator.

Return:

true if all properties are equal.

Since:

BlackBerry 10.0.0

void setCaptionTailCoordinate (

Sets the coordinates within the marker where the caption bubble's tail should point to.

Parameters
captionCoord

The point within the icon where the caption bubble can safely point to.

Since:

BlackBerry 10.0.0

void setIconSize (

Sets the size of the marker's icon.

This must be set to the actual dimensions of the icon image as it is used to position the icon on the map. Values that do not match the icon's dimensions will not cause the icon to be scaled, and may result in incorrect rendering of the icon on the map.

Parameters
iconSize

The new size of the icon.

Since:

BlackBerry 10.0.0

void setIconUri (

Sets the URI location of its graphical icon resource.

If the image that the icon points to doesn't exist, or if it is an invalid image, then no marker is displayed on the map.

Parameters
uri

The path to the local icon. Paths can be absolute paths (eg: /usr/hmi/...), relative paths (relative to the application's root directory, eg: ./app/native/assets/...), file protocols (eg: file:///...) or asset protocols (eg: asset:///...).

Since:

BlackBerry 10.0.0

void setLocationCoordinate (

Sets the coordinates within the marker that represents the location.

Parameters
locCoord

The new coordinates within the marker.

Since:

BlackBerry 10.0.0

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus