A MapGraphicsView renders data in a map and allows users to interact with the map. More...
| Header | #include <Map |
| Since | Esri |
| Inherits | QGraphics |
Public Functions
| Map | |
| Map | |
| virtual | ~ |
Signals
| void | analysis |
(since Esri void | attribution |
(since Esri void | attribution |
| void | draw |
| void | error |
(since Esri void | geo |
(since Esri void | hover |
(since Esri void | hover |
(since Esri void | hover |
| void | key |
| void | key |
| void | layer |
(since Esri void | map |
| void | map |
| void | map |
| void | mouse |
| void | mouse |
| void | mouse |
| void | mouse |
| void | mouse |
| void | mouse |
| void | mouse |
| void | navigating |
| void | rect |
| void | spatial |
| void | touched(QTouch |
| void | viewpoint |
Detailed Description
In an MVC architecture, a MapGraphicsView represents the view and a map represents the model.
A MapGraphicsView implements a map view as a QGraphicsView widget. It is used in user interfaces coded with C++.
Example:
Create a MapGraphicsView and set as central widget:
// create the map view m_mapView = new MapGraphicsView(this); // set central widget with the map view on the QMainWindow setCentralWidget(m_mapView);
See also Map, MapView, and GeoView.
Member Function Documentation
[explicit] MapGraphicsView::MapGraphicsView (QWidget *parent = nullptr)
Default constructor that takes an optional parent.
[explicit] MapGraphicsView::MapGraphicsView (Esri::ArcGISRuntime::Map *map, QWidget *parent = nullptr)
Constructor that takes a map and an optional parent.
[override virtual noexcept] MapGraphicsView::~MapGraphicsView ()
Destructor.
[signal] void MapGraphicsView::analysisViewStateChanged (Esri::ArcGISRuntime::Analysis *analysis, const Esri::ArcGISRuntime::AnalysisViewState &analysisViewState )
Signal emitted when the AnalysisViewState changes.
- analysis - The analysis that had a state change.
- analysisViewState - The AnalysisViewState with the new state information.
The returned Analysis object has the MapGraphicsView as its parent.
See also Returned QObjects Parenting.
[signal, since Esri::ArcGISRuntime 100.1] void MapGraphicsView::attributionRectChanged ()
Emitted when the attribution bounding rectangle changes.
This function was introduced in Esri::ArcGISRuntime 100.1.
[signal, since Esri::ArcGISRuntime 100.1] void MapGraphicsView::attributionTextChanged ()
Emitted when the attribution text changes.
This function was introduced in Esri::ArcGISRuntime 100.1.
[signal] void MapGraphicsView::drawStatusChanged (Esri::ArcGISRuntime::DrawStatus status)
Signal emitted when the DrawStatus changes.
- status - The new DrawStatus.
[signal] void MapGraphicsView::errorOccurred (const Esri::ArcGISRuntime::Error &error)
Signal emitted when an error occurs.
- error - Details about the error.
[signal, since Esri::ArcGISRuntime 300.0] void MapGraphicsView::geoModelErrorChanged (const Esri::ArcGISRuntime::Error &error)
Signal emitted when the geo model error changes.
This error is used to indicate that the geo model assigned to the view had an issue loading or didn't meet the requirements after loading, resulting in nothing rendering on screen.
This signal can be emitted multiple times but only one error can be active at a time. It will be emitted when there is an error and when that error gets cleared. When the error is cleared, then the error is represented as empty.
Examples of a possible error include:
- Geo model has a Loadable::loadError.
- Incompatible Scene::viewingMode.
- Geo model has an incompatible spatial reference.
- Geo model has incompatible vertical and horizontal datums.
- error - The geo model error associated with the view.
This function was introduced in Esri::ArcGISRuntime 300.0.
[signal, since Esri::ArcGISRuntime 200.2] void MapGraphicsView::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 MapGraphicsView::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 MapGraphicsView::hoverMoved (QHoverEvent &hoverEvent )
Emitted when the cursor moves.
- hoverEvent - The hover event.
This function was introduced in Esri::ArcGISRuntime 200.2.
[signal] void MapGraphicsView::keyPressed (QKeyEvent &keyEvent )
Emitted when a key press has been detected.
- keyEvent - The key event.
[signal] void MapGraphicsView::keyReleased (QKeyEvent &keyEvent )
Emitted when a key release has been detected.
- keyEvent - The key event.
[signal] void MapGraphicsView::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 MapGraphicsView as its parent.
See also Returned QObjects Parenting.
[signal, since Esri::ArcGISRuntime 100.3] void MapGraphicsView::mapChanged ()
Emitted when the map changes.
This function was introduced in Esri::ArcGISRuntime 100.3.
[signal] void MapGraphicsView::mapRotationChanged ()
Signal emitted when the mapRotation changes.
[signal] void MapGraphicsView::mapScaleChanged ()
Signal emitted when the mapScale changes.
[signal] void MapGraphicsView::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 MapGraphicsView::mouseDoubleClicked (QMouseEvent &mouseEvent )
Emitted when a double click even is detected.
- mouseEvent - The mouse event.
[signal] void MapGraphicsView::mouseMoved (QMouseEvent &mouseEvent )
Emitted when mouse is moved.
- mouseEvent - The mouse event.
[signal] void MapGraphicsView::mousePressed (QMouseEvent &mouseEvent )
Emitted when mouse is pressed.
- mouseEvent - The mouse event.
[signal] void MapGraphicsView::mousePressedAndHeld (QMouseEvent &mouseEvent )
Emitted when there is a long press and hold (currently 800ms) on the same point.
- mouseEvent - The mouse event.
[signal] void MapGraphicsView::mouseReleased (QMouseEvent &mouseEvent )
Emitted when mouse is release.
- mouseEvent - The mouse event.
[signal] void MapGraphicsView::mouseWheelChanged (QWheelEvent &wheelEvent )
Emitted when mouse wheel movement has been detected.
- wheelEvent - The wheel event.
[signal] void MapGraphicsView::navigatingChanged ()
Signal emitted when the view has started or completed navigating.
[signal] void MapGraphicsView::rectChanged (const QRectF &rect)
Emitted when the visible area changes.
- rect - The new rect representing the visible area.
[signal] void MapGraphicsView::spatialReferenceChanged ()
Signal emitted when the SpatialReference changed.
[signal] void MapGraphicsView::touched(QTouchEvent &event)
Emitted when a touch event has been detected.
Accept the event to prevent the MapGraphicsView from performing its default gesture interaction behavior.
- event - The touch event.
[signal] void MapGraphicsView::viewpointChanged ()
Emitted when the viewpoint changes.