Skip To Content ArcGIS for Developers Sign In Dashboard

CalloutData Class

class Esri::ArcGISRuntime::CalloutData

The data for a Callout view. More...

Header: #include <CalloutData>
Since: Esri::ArcGISRuntime 100.0
Inherits: Esri::ArcGISRuntime::Object

This class was introduced in Esri::ArcGISRuntime 100.0.

Properties

Public Functions

virtual ~CalloutData() override
QString detail() const
Esri::ArcGISRuntime::GeoElement *geoElement() const
QImage image() const
QUrl imageUrl() const
bool isShowCalloutForLocationDisplay() const
bool isVisible() const
Esri::ArcGISRuntime::Point location() const
QPointF screenPoint() const
void setDetail(const QString &detail)
void setGeoElement(Esri::ArcGISRuntime::GeoElement *geoElement)
void setImage(const QImage &image)
void setImageUrl(const QUrl &imageUrl)
void setLocation(const Esri::ArcGISRuntime::Point &location)
void setShowCalloutForLocationDisplay(bool calloutForLocationDisplay)
void setTapLocation(const Esri::ArcGISRuntime::Point &tapLocation)
void setTitle(const QString &title)
void setVisible(bool visible)
Esri::ArcGISRuntime::Point tapLocation() const
QString title() const

Signals

Detailed Description

This class works in conjunction with the Callout view in the ArcGIS Runtime Toolkit, which is used to display information on a map. CalloutData provides the Callout with the content to display in the view and the screen coordinates detailing where to display the view. The content of the callout consists of a title and a detail string. It can also display an image to the left of the title and detail, and an accessory button to the right. The accessory button can be used to present a secondary view with more details, such as a pop up.

A Callout can be displayed for several different scenarios:

Obtain CalloutData from MapView::calloutData. You can change the content of the callout by setting properties on this class. To change the look and feel of the Callout view, set properties on the Callout in the toolkit.

In order to use the CalloutData with a QML UI, the CalloutData class must be registered as a QML Type. For example, the following line could be added to the main.cpp to register the class under the Esri.Samples namespace:

qmlRegisterUncreatableType<CalloutData>("Esri.Samples", 1, 0, "CalloutData", "CalloutData is an uncreatable type");

Note: The default Callout provided with the toolkit is built with Qt Quick for a QML UI. If using Qt Widgets, a custom Widgets UI could be created to consume the information provided by CalloutData.

Example:

Initialize the CalloutData so the QML property is updated:

m_mapView->calloutData()->setVisible(false);
m_mapView->calloutData()->setTitle("Location");
QImage image(":/Samples/DisplayInformation/ShowCallout/RedShinyPin.png");
m_mapView->calloutData()->setImage(image);

Finally, set the CalloutData to the Callout view component from the Toolkit:

Callout {
    id: callout
    calloutData: mapView.calloutData // bind to the property that is exposed
    accessoryButtonHidden: true
    leaderPosition: leaderPositionEnum.Automatic
}

Property Documentation

detail : QString

This property holds the detail text for the callout.

Access functions:

QString detail() const
void setDetail(const QString &detail)

Notifier signal:

void detailChanged()

imageUrl : QUrl

This property holds the local file or online URL of the callout image.

Access functions:

QUrl imageUrl() const
void setImageUrl(const QUrl &imageUrl)

Notifier signal:

screenPoint : const QPointF

This property holds the screen coordinates where the callout is displayed (read-only).

Access functions:

QPointF screenPoint() const

Notifier signal:

title : QString

This property holds the title text for the callout.

Access functions:

QString title() const
void setTitle(const QString &title)

Notifier signal:

void titleChanged()

visible : bool

This property holds whether the Callout is visible.

Returns true if the Callout is visible.

Access functions:

bool isVisible() const
void setVisible(bool visible)

Notifier signal:

Member Function Documentation

[signal] void CalloutData::detailChanged()

Emitted when the detail property changes.

Note: Notifier signal for property detail.

[signal] void CalloutData::imageUrlChanged()

Emitted when the imageUrl property changes.

Note: Notifier signal for property imageUrl.

[signal] void CalloutData::screenPointChanged()

Emitted when the screenPoint property changes.

Note: Notifier signal for property screenPoint.

[signal] void CalloutData::titleChanged()

Emitted when the title property changes.

Note: Notifier signal for property title.

[signal] void CalloutData::visibleChanged()

Emitted when the visible property changes.

Note: Notifier signal for property visible.

[override virtual] CalloutData::~CalloutData()

Destructor.

Esri::ArcGISRuntime::GeoElement *CalloutData::geoElement() const

Gets the GeoElement for which the callout should be displayed.

If you specify the optional tapLocation parameter, the callout displays at the point on the geometry nearest to tapLocation.

Note: Only supports Feature and Graphic GeoElements.

See also setGeoElement().

QImage CalloutData::image() const

The callout image returned as a QImage.

See also setImage().

bool CalloutData::isShowCalloutForLocationDisplay() const

Gets whether the callout is being shown for the LocationDisplay on the map.

Returns true if the callout will display at the current location.

Esri::ArcGISRuntime::Point CalloutData::location() const

Gets the map location where the callout should be displayed.

See also setLocation().

void CalloutData::setDetail(const QString &detail)

Sets the detail text for the callout to detail.

Note: Setter function for property detail.

See also detail().

void CalloutData::setGeoElement(Esri::ArcGISRuntime::GeoElement *geoElement)

Sets the GeoElement for the callout geoElement.

See also geoElement().

void CalloutData::setImage(const QImage &image)

Sets the image for the callout.

The image can be set by either specifying the QImage or by a URL using the setImageUrl method. It overwrites a previously set imageUrl.

See also image().

void CalloutData::setImageUrl(const QUrl &imageUrl)

Sets the imageUrl for the callout.

The URL can either be to a local file or an online resource.

Note: Setter function for property imageUrl.

See also imageUrl().

void CalloutData::setLocation(const Esri::ArcGISRuntime::Point &location)

Sets the location of the callout display to location.

See also location().

void CalloutData::setShowCalloutForLocationDisplay(bool calloutForLocationDisplay)

Sets whether the callout is being shown for the LocationDisplay on the map.

Set calloutForLocationDisplay to true if you want the callout to be displayed for your current location.

See also isShowCalloutForLocationDisplay().

void CalloutData::setTapLocation(const Esri::ArcGISRuntime::Point &tapLocation)

Sets the tap location for the callout to tapLocation.

If the callout is shown for a GeoElement, tapLocation specifies the optional location where the callout should be displayed.

See also tapLocation().

void CalloutData::setTitle(const QString &title)

Sets the title text for the callout to title.

Note: Setter function for property title.

See also title().

void CalloutData::setVisible(bool visible)

Sets the callout to be visible or invisible.

Note: Setter function for property visible.

See also isVisible().

Esri::ArcGISRuntime::Point CalloutData::tapLocation() const

Gets the tap location for the callout.

See also setTapLocation().


Feedback on this topic?