Basemap Class

  • Basemap
  • class Esri::ArcGISRuntime::Basemap

    A basemap that can be displayed in a map. More...

    This class was introduced in Esri::ArcGISRuntime 100.0.

    Public Functions

    Basemap(const QList<Esri::ArcGISRuntime::Layer *> &baseLayers, const QList<Esri::ArcGISRuntime::Layer *> &referenceLayers, QObject *parent = nullptr)
    Basemap(Esri::ArcGISRuntime::BasemapStyle basemapStyle, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
    Basemap(Esri::ArcGISRuntime::BasemapStyle basemapStyle, QObject *parent = nullptr)
    Basemap(Esri::ArcGISRuntime::Layer *baseLayer, QObject *parent = nullptr)
    Basemap(const QUrl &url, QObject *parent = nullptr)
    Basemap(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)
    Basemap(QObject *parent = nullptr)
    virtual ~Basemap() override
    Esri::ArcGISRuntime::LayerListModel *baseLayers() const
    Esri::ArcGISRuntime::Item *item() const
    QString name() const
    Esri::ArcGISRuntime::LayerListModel *referenceLayers() const
    void setName(const QString &name)

    Reimplemented Public Functions

    virtual QString apiKey() const override
    virtual void cancelLoad() override
    virtual Esri::ArcGISRuntime::Credential *credential() const override
    virtual void load() override
    virtual Esri::ArcGISRuntime::Error loadError() const override
    virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
    virtual Esri::ArcGISRuntime::RequestConfiguration requestConfiguration() const override
    virtual void retryLoad() override
    virtual void setApiKey(const QString &apiKey) override
    virtual void setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override
    virtual QString toJson() const override
    virtual QJsonObject unknownJson() const override
    virtual QJsonObject unsupportedJson() const override
    virtual QUrl url() const override

    Signals

    void doneLoading(Esri::ArcGISRuntime::Error loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Static Public Members

    Esri::ArcGISRuntime::Basemap *fromJson(const QString &json, QObject *parent = nullptr)

    Detailed Description

    A basemap provides a background of geographical context for the content you want to display in the map. It is used for locational reference and provides a framework on which you can overlay operational layers, perform analysis, and visualize geographic information. Thus, the basemap serves as a foundation and provides a framework for working with information geographically.

    ArcGIS Online provides a number of ready-to-use basemaps for streets, topography, shaded relief, and so on. If you prefer, you can create your own basemap by mashing up layers.

    A basemap is composed of a collection of base layers and reference layers. Base layers are displayed at the bottom of a map, and reference layers are displayed at the top, with the map's operational layers sandwiched between them. The content of a basemap is typically static and does not change frequently.

    Typically, you will use one basemap layer that is drawn beneath all other layers, but you can also add a basemap layer on top of all other layers to depict boundaries, labels, or a road network.

    In order to take advantage of geographically load balanced services and monitor usage with API keys or named users, use Basemap(BasemapStyle, QObject* parent). Example:

    Add a tiled map service to a map's basemap:

    ArcGISTiledLayer* tiledLayer = new ArcGISTiledLayer(streetMapServiceUrl, this);
    Basemap* basemap = new Basemap(tiledLayer, this);
    Map* map = new Map(basemap, this);

    See also BasemapStyle.

    Member Function Documentation

    Basemap::Basemap(const QList<Esri::ArcGISRuntime::Layer *> &baseLayers, const QList<Esri::ArcGISRuntime::Layer *> &referenceLayers, QObject *parent = nullptr)

    Construct a Basemap from baseLayers and referenceLayers with an optional parent.

    Basemap::Basemap(Esri::ArcGISRuntime::BasemapStyle basemapStyle, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)

    Construct a Basemap with a style and a credential.

    • basemapStyle - The basemap style.
    • credential - the credential to use.
    • parent - The optional parent QObject.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    Basemap::Basemap(Esri::ArcGISRuntime::BasemapStyle basemapStyle, QObject *parent = nullptr)

    Construct a Basemap with a style.

    • basemapStyle - The basemap style.
    • parent - The optional parent QObject.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    See also BasemapStyle.

    Basemap::Basemap(Esri::ArcGISRuntime::Layer *baseLayer, QObject *parent = nullptr)

    Construct a Basemap from a baseLayer with an optional parent.

    Basemap::Basemap(const QUrl &url, QObject *parent = nullptr)

    Construct a Basemap from a url with an optional parent.

    url may be a direct URL to web map JSON content or the URL of a portal item.

    The URL can be one of three possible types:

    Basemap::Basemap(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)

    Construct a Basemap from an item with an optional parent.

    Basemap::Basemap(QObject *parent = nullptr)

    Default constructor with an optional parent.

    [signal] void Basemap::doneLoading(Esri::ArcGISRuntime::Error loadError)

    Signal emitted when Basemap is done loading.

    • loadError - Details about any error that may have occurred.

    Note: If there is a load error it will also be emitted on the errorOccurred signal.

    See also Loadable and Object.

    [signal] void Basemap::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    loadStatus See Loadable.

    [override virtual] Basemap::~Basemap()

    Destructor.

    [override virtual] QString Basemap::apiKey() const

    Reimplements: ApiKeyResource::apiKey() const.

    Returns the API key. See ApiKeyResource.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also setApiKey().

    Esri::ArcGISRuntime::LayerListModel *Basemap::baseLayers() const

    Returns the base layers.

    The collection is specific to a basemap, so you cannot reuse a layer collection coming from another Map or Basemap.

    See also GeoModel::operationalLayers and baseLayers.

    [override virtual] void Basemap::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    See Loadable.

    [override virtual] Esri::ArcGISRuntime::Credential *Basemap::credential() const

    Reimplements: RemoteResource::credential() const.

    Returns the security credential used to access the basemap.

    [static] Esri::ArcGISRuntime::Basemap *Basemap::fromJson(const QString &json, QObject *parent = nullptr)

    Creates a new Basemap from json with an optional parent.

    See also JsonSerializable.

    Esri::ArcGISRuntime::Item *Basemap::item() const

    Gets the item.

    Returns The item.

    [override virtual] void Basemap::load()

    Reimplements: Loadable::load().

    See Loadable.

    [override virtual] Esri::ArcGISRuntime::Error Basemap::loadError() const

    Reimplements: Loadable::loadError() const.

    See Loadable.

    [override virtual] Esri::ArcGISRuntime::LoadStatus Basemap::loadStatus() const

    Reimplements: Loadable::loadStatus() const.

    See Loadable.

    QString Basemap::name() const

    Gets the name of the Basemap.

    Returns the name.

    See also setName().

    Esri::ArcGISRuntime::LayerListModel *Basemap::referenceLayers() const

    Gets the reference layers as a LayerListModel.

    Returns The reference layers.

    [override virtual] Esri::ArcGISRuntime::RequestConfiguration Basemap::requestConfiguration() const

    Reimplements: RemoteResource::requestConfiguration() const.

    Returns the RequestConfiguration in use by this basemap.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    See also setRequestConfiguration().

    [override virtual] void Basemap::retryLoad()

    Reimplements: Loadable::retryLoad().

    See Loadable.

    [override virtual] void Basemap::setApiKey(const QString &apiKey)

    Reimplements: ApiKeyResource::setApiKey(const QString &apiKey).

    Sets the API key to apiKey. See ApiKeyResource.

    This function was introduced in Esri::ArcGISRuntime 100.11.

    See also apiKey().

    void Basemap::setName(const QString &name)

    Sets the name of the Basemap.

    • name - The new Basemap name.

    See also name().

    [override virtual] void Basemap::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration)

    Reimplements: RemoteResource::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration).

    Sets configuration parameters used for network requests sent by this basemap to requestConfiguration.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    See also requestConfiguration().

    [override virtual] QString Basemap::toJson() const

    Reimplements: JsonSerializable::toJson() const.

    Gets the json representation of this object.

    See also JsonSerializable.

    [override virtual] QJsonObject Basemap::unknownJson() const

    Reimplements: JsonSerializable::unknownJson() const.

    Gets the unknown JSON of this object.

    See also JsonSerializable.

    [override virtual] QJsonObject Basemap::unsupportedJson() const

    Reimplements: JsonSerializable::unsupportedJson() const.

    Gets the unsupported JSON of this object.

    See also JsonSerializable.

    [override virtual] QUrl Basemap::url() const

    Reimplements: RemoteResource::url() const.

    Gets the URL of the Basemap.

    Returns the URL.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.