A MapQuickView renders data in a map and allows users to interact with the map. More...
Header: | #include <MapQuickView.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::NativeQuickItem and Esri::ArcGISRuntime::MapView |
Properties
- attributionRect : const QRectF
- calloutData : Esri::ArcGISRuntime::CalloutData* const
Public Functions
MapQuickView(QQuickItem *parent = nullptr) | |
MapQuickView(Esri::ArcGISRuntime::Map *map, QQuickItem *parent = nullptr) | |
virtual | ~MapQuickView() override |
QVariant | attributionTop() const |
Signals
void | attributionRectChanged() |
void | attributionTextChanged() |
void | attributionTopChanged() |
void | drawStatusChanged(Esri::ArcGISRuntime::DrawStatus status) |
void | errorOccurred(const Esri::ArcGISRuntime::Error &error) |
void | hoverEntered(QHoverEvent &hoverEvent) |
void | hoverLeft(QHoverEvent &hoverEvent) |
void | hoverMoved(QHoverEvent &hoverEvent) |
void | keyPressed(QKeyEvent &keyEvent) |
void | keyReleased(QKeyEvent &keyEvent) |
void | layerViewStateChanged(Esri::ArcGISRuntime::Layer *layer, const Esri::ArcGISRuntime::LayerViewState &layerViewState) |
void | mapChanged() |
void | mapRotationChanged() |
void | mapScaleChanged() |
void | mouseClicked(QMouseEvent &mouseEvent) |
void | mouseDoubleClicked(QMouseEvent &mouseEvent) |
void | mouseMoved(QMouseEvent &mouseEvent) |
void | mousePressed(QMouseEvent &mouseEvent) |
void | mousePressedAndHeld(QMouseEvent &mouseEvent) |
void | mouseReleased(QMouseEvent &mouseEvent) |
void | mouseWheelChanged(QWheelEvent &wheelEvent) |
void | navigatingChanged() |
void | rectChanged(const QRectF &rect) |
void | spatialReferenceChanged() |
void | touched(QTouchEvent &event) |
void | viewpointChanged() |
Detailed Description
In an MVC architecture, a MapQuickView represents the view and a map represents the model.
A MapQuickView implements a map view as a QQuickItem component. This allows it to be used in a user interface coded in QML while being controlled by C++ code.
Example:
Register the MapQuickView type as a QML type:
qmlRegisterType<MapQuickView>("Esri.Samples", 1, 0, "MapView");
Declare the MapView in QML, and assign an object name:
MapView { id: view anchors.fill: parent Component.onCompleted: { // Set and keep the focus on MapView to enable keyboard navigation forceActiveFocus(); } }
Obtain the MapView from C++ and set a Map to the MapView:
// Set the view (created in QML) void DisplayMap::setMapView(MapQuickView* mapView) { if (!mapView || mapView == m_mapView) return; m_mapView = mapView; m_mapView->setMap(m_map); emit mapViewChanged(); }
See also Map, MapView, and GeoView.
Property Documentation
[read-only, since Esri::ArcGISRuntime 100.3]
attributionRect : const QRectF
This property holds the bounding rectangle of the attribution text (read-only).
This bounding rectangle can be used when calculating where items can be displayed on the screen so they are not overlapping the attribution text.
This property was introduced in Esri::ArcGISRuntime 100.3.
Notifier signal:
void | attributionRectChanged() |
[read-only, since Esri::ArcGISRuntime 100.8]
calloutData : Esri::ArcGISRuntime::CalloutData * const
Gets the callout data from the map view.
This property was introduced in Esri::ArcGISRuntime 100.8.
Member Function Documentation
[explicit]
MapQuickView::MapQuickView (QQuickItem *parent = nullptr)
Default constructor that takes an optional parent.
[explicit]
MapQuickView::MapQuickView (Esri::ArcGISRuntime::Map *map, QQuickItem *parent = nullptr)
Constructor that takes a map and an optional parent.
[override virtual]
MapQuickView::~MapQuickView ()
Destructor.
[signal, since Esri::ArcGISRuntime 100.1]
void MapQuickView::attributionRectChanged ()
Emitted when the attribution bounding rectangle changes.
Note: Notifier signal for property attributionRect.
This function was introduced in Esri::ArcGISRuntime 100.1.
[signal, since Esri::ArcGISRuntime 100.1]
void MapQuickView::attributionTextChanged ()
Emitted when the attribution text changes.
This function was introduced in Esri::ArcGISRuntime 100.1.
[since Esri::ArcGISRuntime 100.1]
QVariant MapQuickView::attributionTop () const
Gets the top anchor line of the attribution bounding rectangle as an AnchorLine variant.
Other QtQuick items can be anchored to this property so that they display above the attribution text.
Note: Getter function for property attributionTop.
This function was introduced in Esri::ArcGISRuntime 100.1.
[signal, since Esri::ArcGISRuntime 100.1]
void MapQuickView::attributionTopChanged ()
Emitted when the attributionTop anchor line changes.
Note: Notifier signal for property attributionTop.
This function was introduced in Esri::ArcGISRuntime 100.1.
[signal]
void MapQuickView::drawStatusChanged (Esri::ArcGISRuntime::DrawStatus status)
Signal emitted when the DrawStatus changes.
- status - The new DrawStatus.
[signal]
void MapQuickView::errorOccurred (const Esri::ArcGISRuntime::Error &error)
Signal emitted when an error occurs.
- error - Details about the error.
[signal, since Esri::ArcGISRuntime 200.2]
void MapQuickView::hoverEntered (QHoverEvent &hoverEvent )
Emitted when the cursor enters.
- hoverEvent - The hover event.
This function was introduced in Esri::ArcGISRuntime 200.2.
[signal, since Esri::ArcGISRuntime 200.2]
void MapQuickView::hoverLeft (QHoverEvent &hoverEvent )
Emitted when the cursor leaves.
- hoverEvent - The hover event.
This function was introduced in Esri::ArcGISRuntime 200.2.
[signal, since Esri::ArcGISRuntime 200.2]
void MapQuickView::hoverMoved (QHoverEvent &hoverEvent )
Emitted when the cursor moves.
- hoverEvent - The hover event.
This function was introduced in Esri::ArcGISRuntime 200.2.
[signal]
void MapQuickView::keyPressed (QKeyEvent &keyEvent )
Emitted when a key pressed has been detected.
- keyEvent - The key event.
[signal]
void MapQuickView::keyReleased (QKeyEvent &keyEvent )
Emitted when a key release has been detected.
- keyEvent - The key event.
[signal]
void MapQuickView::layerViewStateChanged (Esri::ArcGISRuntime::Layer *layer, const Esri::ArcGISRuntime::LayerViewState &layerViewState )
Signal emitted when the LayerViewState changes.
- layer - The layer that had a state change.
- layerViewState - The LayerViewState with the new state information.
The returned Layer object has the MapQuickView as its parent.
See also Returned QObjects Parenting.
[signal, since Esri::ArcGISRuntime 100.3]
void MapQuickView::mapChanged ()
Emitted when the map changes.
This function was introduced in Esri::ArcGISRuntime 100.3.
[signal]
void MapQuickView::mapRotationChanged ()
Signal emitted when the mapRotation changes.
[signal]
void MapQuickView::mapScaleChanged ()
Signal emitted when the mapScale changes.
[signal]
void MapQuickView::mouseClicked (QMouseEvent &mouseEvent )
Emitted when mouse is pressed and released over the same location.
- mouseEvent - The mouse event.
Note: mousePressedAndHeld takes precedence. If the press and hold gesture is active, releasing the mouse/finger in the same location will not emit mouseClicked.
[signal]
void MapQuickView::mouseDoubleClicked (QMouseEvent &mouseEvent )
Emitted when a double click even is detected.
- mouseEvent - The mouse event.
[signal]
void MapQuickView::mouseMoved (QMouseEvent &mouseEvent )
Emitted when mouse is moved.
- mouseEvent - The mouse event.
[signal]
void MapQuickView::mousePressed (QMouseEvent &mouseEvent )
Emitted when mouse is pressed.
- mouseEvent - The mouse event.
[signal]
void MapQuickView::mousePressedAndHeld (QMouseEvent &mouseEvent )
Emitted when there is a long press and hold (currently 800ms) on the same point.
- mouseEvent - The mouse event.
[signal]
void MapQuickView::mouseReleased (QMouseEvent &mouseEvent )
Emitted when mouse is release.
- mouseEvent - The mouse event.
[signal]
void MapQuickView::mouseWheelChanged (QWheelEvent &wheelEvent )
Emitted when mouse wheel movement has been detected.
- wheelEvent - The wheel event.
[signal]
void MapQuickView::navigatingChanged ()
Signal emitted when the view has started or completed navigating.
[signal]
void MapQuickView::rectChanged (const QRectF &rect)
Emitted when the visible area changes.
- rect - The new rect representing the visible area.
[signal]
void MapQuickView::spatialReferenceChanged ()
Signal emitted when the SpatialReference changed.
[signal]
void MapQuickView::touched(QTouchEvent &event)
Emitted when a touch event has been detected.
Accept the event to prevent the MapQuickView from performing its default gesture interaction behavior.
- event - The touch event.
[signal]
void MapQuickView::viewpointChanged ()
Emitted when the viewpoint changes.