A list model storing a list of graphics available in a GraphicsOverlay. More...
Import Statement: | import Esri.ArcGISRuntime 100.15 |
Since: | Esri.ArcGISRuntime 100.0 |
Properties
- count : int
Signals
- countChanged()
- itemAdded(int index)
- itemRemoved(int index)
Methods
- void append(Graphic graphic)
- void appendAll(list<Graphic> graphics)
- void clear()
- bool contains(Graphic graphic)
- error forEach(callback)
- Graphic get(int index)
- int indexOf(Graphic graphic)
- void insert(int index, Graphic graphic)
- void move(int from, int to)
- void remove(int index, int count)
- void removeOne(Graphic graphic)
Detailed Description
Note: You cannot declare or create a component of this type in QML code.
Modifying this model (adding, removing, moving) will update the graphics available in the GraphicsOverlay. Moving a graphic's position in the list model does not affect drawing order. To change drawing order for a graphic, set the zIndex
property on the Graphic.
The model returns data for the following roles:
Role | Type | Description |
---|---|---|
selected | bool | Whether the graphic is selected. |
graphicVisible | bool | Whether the graphic is visible. |
zIndex | int | The z index of the graphic. |
attributes | AttributeListModel | The attributes of the graphic as an AttributeListModel. |
Property Documentation
Signal Documentation
Emitted when the count property of the model changes.
Note: The corresponding handler is onCountChanged
.
Emitted when an item is added to the list model at the index specified in the parameter.
Note: The corresponding handler is onItemAdded
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Emitted when an item is removed from the list model at the index specified in the parameter.
Note: The corresponding handler is onItemRemoved
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Method Documentation
void append(Graphic graphic) |
Appends a graphic to the graphic list model.
void appendAll(list<Graphic> graphics) |
Appends a graphics to the graphic list model.
bool contains(Graphic graphic) |
Returns true
if the list model contains the specified graphic.
Receives a callback function to execute for each graphic in the model.
The callback function can take 0 to 3 optional arguments, in order:
- element Current class break.
- index Current index in array.
- array Reference to GraphicListModel.
Returns undefined if no error occurred, and an error message otherwise.
const error = graphicListModel.forEach(function(element, index, array) { ... }); if (error) { console.error(error.message); }
Graphic get(int index) |
Returns the Graphic
at the specified index.
int indexOf(Graphic graphic) |
Returns the index of the graphic specified.
This method was introduced in Esri::ArcGISRuntime 100.5..
void insert(int index, Graphic graphic) |
Inserts a graphic at a specified index in the list.
Removes one or more objects starting at the specified index.
- index Index of first object to remove.
- count Number of objects to remove. This parameter defaults to
1
.
void removeOne(Graphic graphic) |
Removes the specified graphic (graphic) from the list model.
This method was introduced in Esri::ArcGISRuntime 100.5..