BasemapListModel QML Type
The result of fetching the basemaps available for a portal. More...
Import Statement: | import Esri.ArcGISRuntime |
Since: | Esri.ArcGISRuntime 100.0 |
- List of all members, including inherited members
- BasemapListModel is part of QML Type List.
Properties
Signals
- countChanged()
- errorChanged()
- itemAdded(int index)
- itemRemoved(int index)
Methods
- void append(Basemap basemap)
- void clear()
- bool contains(Basemap basemap)
- error forEach(callback)
- Basemap get(int index)
- int indexOf(Basemap basemap)
- void insert(int index, Basemap basemap)
- void move(int from, int to)
- void remove(int index, int count)
- void removeOne(Basemap basemap)
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
[read-only] count : int |
Returns the number of objects in the model (read-only).
[read-only] error : Error |
Returns the Error object (read-only).
Signal Documentation
countChanged() |
Emitted when the count
property of the model changes.
Note: The corresponding handler is onCountChanged
.
errorChanged() |
Signal emitted when the error
property changes, which can indicate that an error occurred.
Note: The corresponding handler is onErrorChanged
.
|
Signal emitted when an item is added to the list model.
index is the index of the added item.
Note: The corresponding handler is onItemAdded
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
|
Signal emitted when an item is removed from the list model.
index is the index of the removed item.
Note: The corresponding handler is onItemRemoved
.
This signal was introduced in Esri.ArcGISRuntime 100.15.
Method Documentation
void clear() |
Removes all basemaps from the list model.
bool contains(Basemap basemap) |
Returns true
if the list model contains the specified basemap.
error forEach(callback) |
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.
const 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..
void insert(int index, Basemap basemap) |
Inserts a Basemap basemap at the specified index in the list.
void move(int from, int to) |
Moves one Basemap from an index in the list model to a different index.
void remove(int index, int count = 1) |
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..