BasemapListModel QML Type
The result of fetching the basemaps available for a portal. More...
Import Statement: | import Esri.ArcGISRuntime 100.9 |
Since: | Esri.ArcGISRuntime 100.0 |
Properties
Signals
- basemapAdded(index)
- basemapRemoved(index)
- countChanged()
- errorChanged()
Methods
- void append(basemap)
- void clear()
- bool contains(basemap)
- void forEach(callback)
- Basemap get(index)
- int indexOf(basemap)
- void insert(index, Basemap basemap)
- void move(from, int to)
- void remove(index, int count = 1)
- void removeOne(basemap)
- void setProperty(index, string property, variant value)
Detailed Description
The request is made by calling fetchBasemaps and if the operation is succesful, this type is returned by the portal's basemaps method.
The basemaps contained in the model are initially unloaded.
The model returns data for the following roles:
Role | Type | Description |
---|---|---|
name | string | The basemap's name. |
url | url | The basemap's URL. |
accessInformation | string | The item's access information. |
created | date | The date this item was created. |
description | string | The item's description. |
itemId | string | The item's ID. |
type | Enums.ItemType | The item's type. |
modified | date | The date this item was last modified. |
snippet | string | The item's snippet. |
tags | list<string> | The item's tags. |
title | string | The item's title. |
thumbnailUrl | url | The local file URL of the thumbnail image for this item. |
Example: Accessing roles from a BasemapListModel from within a QML delegate:
Image {
id: basemapImg
anchors {
bottom: basemapLabel.top;
horizontalCenter: parent.horizontalCenter
}
height: parent.height - ( basemapLabel.height * 2 );
width: height
source: thumbnailUrl
fillMode: Image.PreserveAspectCrop
}
Text {
id: basemapLabel
anchors {
bottom: parent.bottom;
left: parent.left;
right: parent.right
}
height: 16
z: 100
horizontalAlignment: Text.AlignHCenter
text: title
wrapMode: Text.Wrap
elide: Text.ElideRight
font.pointSize: 8
font.bold: index === basemapsGrid.currentIndex
}
See also Portal, Basemap, and Loadable.
Property Documentation
error : Error |
Returns the Error object (read-only).
Signal Documentation
Signal emitted when a basemap is added to the list model.
index is the index of the added Basemap.
Note: The corresponding handler is onBasemapAdded
.
Signal emitted when a basemap is removed from the list model.
index is the index of the removed Basemap.
Note: The corresponding handler is onBasemapRemoved
.
Emitted when the count
property of the model changes.
Note: The corresponding handler is onCountChanged
.
Signal emitted when the error
property changes, which can indicate that an error occurred.
Note: The corresponding handler is onErrorChanged
.
Method Documentation
Appends a Basemap basemap to the list model.
Receives a callback function to execute for each Basemap in the model.
The callback function can take 0 to 3 optional arguments, in order:
- element Current Basemap.
- index Current index in array.
- array Reference to BasemapListModel.
Returns undefined if no error occurred, and an error message otherwise.
var error = BasemapListModel.forEach(function(element, index, array) {
...
});
if (error) {
console.error(error.message);
}
Returns the index of the basemap specified.
This method was introduced in Esri::ArcGISRuntime 100.5..
Moves one Basemap from an index in the list model to a different index.
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
.
Removes the specified basemap (basemap) from the list model.
This method was introduced in Esri::ArcGISRuntime 100.5..
Changes the property of the Basemap at index in the list model to value.