ArcGIS Developers

BasemapListModel QML Type

The result of fetching the basemaps available for a portal. More...

Import Statement: import Esri.ArcGISRuntime 100.10
Since: Esri.ArcGISRuntime 100.0




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:

namestringThe basemap's name.
urlurlThe basemap's URL.
accessInformationstringThe item's access information.
createddateThe date this item was created.
descriptionstringThe item's description.
itemIdstringThe item's ID.
typeEnums.ItemTypeThe item's type.
modifieddateThe date this item was last modified.
snippetstringThe item's snippet.
tagslist<string>The item's tags.
titlestringThe item's title.
thumbnailUrlurlThe 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 {
        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

count : int

Returns the number of objects in the model (read-only).

error : Error

Returns the Error object (read-only).

Signal Documentation

basemapAdded(int index)

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.

basemapRemoved(int index)

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

void append(Basemap basemap)

Appends a Basemap basemap to the list model.

void clear()

Removes all basemaps from the list model.

bool contains(Basemap basemap)

Returns true if the list model contains the specified basemap.

void 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:

Returns undefined if no error occurred, and an error message otherwise.

var error = BasemapListModel.forEach(function(element, index, array) {
if (error) {

Basemap get(int index)

Returns the Basemap at the specified index.

int indexOf(Basemap basemap)

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.

void removeOne(Basemap basemap)

Removes the specified basemap (basemap) from the list model.

This method was introduced in Esri::ArcGISRuntime 100.5..

void setProperty(int index, string property, variant value)

Changes the property of the Basemap at index in the list model to value.

Feedback on this topic?