Layer Class

  • Layer
  • class Esri::ArcGISRuntime::Layer

    Represents a layer that displays data on a map. More...

    This class was introduced in Esri::ArcGISRuntime 100.0.

    Public Functions

    virtual ~Layer() override
    QString attribution() const
    QString description() const
    Esri::ArcGISRuntime::Envelope fullExtent() const
    bool isIdentifyEnabled() const
    Esri::ArcGISRuntime::Item *item() const
    QString layerId() const
    Esri::ArcGISRuntime::LayerType layerType() const
    double maxScale() const
    double minScale() const
    float opacity() const
    void setDescription(const QString &description)
    void setLayerId(const QString &layerId)
    void setMaxScale(double maxScale)
    void setMinScale(double minScale)
    void setName(const QString &name)
    void setOpacity(float opacity) const
    Esri::ArcGISRuntime::SpatialReference spatialReference() const

    Reimplemented Public Functions

    virtual bool canChangeVisibility() const override
    virtual void cancelLoad() override
    virtual bool isAutoFetchLegendInfos() const override
    virtual bool isShowInLegend() const override
    virtual bool isVisible() const override
    virtual bool isVisibleAtScale(double scale) const override
    virtual Esri::ArcGISRuntime::LegendInfoListModel *legendInfos() const override
    virtual void load() override
    virtual Esri::ArcGISRuntime::Error loadError() const override
    virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
    virtual QString name() const override
    virtual void retryLoad() override
    virtual void setAutoFetchLegendInfos(bool autoFetchLegendInfos) override
    virtual void setShowInLegend(bool showInLegend) override
    virtual void setVisible(bool visible) override
    virtual QList<Esri::ArcGISRuntime::LayerContent *> subLayerContents() const override


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

    Detailed Description

    This base class contains methods to call on layer subclasses to change extent, draw, and so on.

    Layer is the base class for all layer types. A layer is a representation of geographic data portrayed using symbols and text labels. Multiple layers can be 'stacked' to enhance the information displayed. Layers are displayed in a Map inside a MapView control. Layers are drawn bottom-to-top, so the first layer in a map's layer collection is drawn first (on the bottom) and each subsequent layer is drawn on top of it.

    Layer is the base class for all these layer types:

    Layer type2D/3DTime-awareOnline/offlineSources
    AnnotationLayer2DNoBothArcGIS feature service, portal item, mobile map package (.mmpk)
    ArcGISMapImageLayerBothYesOnlineArcGIS map service
    ArcGISSceneLayer3DNoBothScene service or scene package
    ArcGISTiledLayerBothNoArcGIS tile service, tile package (.tpk/.tpkx)
    ArcGISVectorTiledLayer2DNoBothArcGIS vector tile service, vector tile package (.vtpk)
    BingMapsLayerBothNoOnlineBing maps
    EncLayer2DNoOfflineENC exchange set, ENC cell
    FeatureCollectionLayerBothNoBothPortal item, web map, feature set / query result
    FeatureLayerBothYesBothArcGIS feature service, WFS, shapefile, GeoPackage, geodatabase, OGC API Features
    GroupLayerBothNoBothOther layers and group layers
    KmlLayerBothYesBothKML file (.kml, .kmz)
    IntegratedMeshLayer3DNoBothScene later package (.slpk)
    MobileBasemapLayer2DNoOfflineMobile map package (.mmpk)
    PointCloudLayer3DNoBothPortal item, scene layer package (.slpk)
    RasterLayerBothYesBothGeoPackage, raster file, ArcGIS Image service
    SubtypeFeatureLayer2DNoBothArcGIS feature service, geodatabase
    WebTiledLayerBothNoOnlineWeb tile service
    WmsLayerBothYesOnlineWMS service
    WmtsLayerBothNoOnlineWMTS service

    Member Function Documentation

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

    Signal emitted when this object 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 Layer::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Signal emitted when the loadStatus changes for this object.

    See also Loadable.

    [signal] void Layer::visibleChanged(bool visible)

    Signal emitted when the isVisible property changes for this object.

    • visible - The current visibility of the layer.

    This function was introduced in Esri::ArcGISRuntime 100.9.

    [override virtual] Layer::~Layer()


    QString Layer::attribution() const

    Gets the layer's attribution if any is available.

    [override virtual] bool Layer::canChangeVisibility() const

    Reimplements: LayerContent::canChangeVisibility() const.

    Returns whether the layer's visibility can be changed.

    See LayerContent.

    [override virtual] void Layer::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    See Loadable.

    QString Layer::description() const

    Gets the layer's description.

    For service layers, the description is defined by the service when the layer initializes.

    See also setDescription().

    Esri::ArcGISRuntime::Envelope Layer::fullExtent() const

    Gets the full extent of the layer.

    Returns an empty Envelope if the layer does not have a defined full extent.

    [override virtual] bool Layer::isAutoFetchLegendInfos() const

    Reimplements: LayerContent::isAutoFetchLegendInfos() const.

    Returns whether legend infos are automatically fetched by the layer's legend info list model.

    See LayerContent.

    bool Layer::isIdentifyEnabled() const

    Returns whether the layer supports identify.

    [override virtual] bool Layer::isShowInLegend() const

    Reimplements: LayerContent::isShowInLegend() const.

    Returns whether the layer will be shown in the legend.

    See LayerContent.

    [override virtual] bool Layer::isVisible() const

    Reimplements: LayerContent::isVisible() const.

    Returns whether the layer is enabled to be visible.

    See LayerContent.

    [override virtual] bool Layer::isVisibleAtScale(double scale) const

    Reimplements: LayerContent::isVisibleAtScale(double scale) const.

    Returns whether the sublayer is visible at a given scale.

    See LayerContent.

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

    Gets the item the layer has been created from.

    QString Layer::layerId() const

    Gets the layer's ID specified in the web map JSON.

    See also setLayerId().

    Esri::ArcGISRuntime::LayerType Layer::layerType() const

    Gets the layer's type.

    [override virtual] Esri::ArcGISRuntime::LegendInfoListModel *Layer::legendInfos() const

    Reimplements: LayerContent::legendInfos() const.

    Returns a list of legend information for the layer and any sublayers.

    See LayerContent.

    [override virtual] void Layer::load()

    Reimplements: Loadable::load().

    See Loadable.

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

    Reimplements: Loadable::loadError() const.

    See Loadable.

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

    Reimplements: Loadable::loadStatus() const.

    See Loadable.

    double Layer::maxScale() const

    Gets the maximum scale at which the layer displays.

    For service layers, this is defined by the service.

    See also setMaxScale().

    double Layer::minScale() const

    Gets the minimum scale at which the layer displays.

    For service layers, this is defined by the service.

    See also setMinScale().

    [override virtual] QString Layer::name() const

    Reimplements: LayerContent::name() const.

    Gets the layer's name.

    See LayerContent.

    See also setName().

    float Layer::opacity() const

    Gets the opacity of the layer between 0.0 and 1.0.

    0.0 is transparent and 1.0 is solid or opaque.

    See also setOpacity().

    [override virtual] void Layer::retryLoad()

    Reimplements: Loadable::retryLoad().

    See Loadable.

    [override virtual] void Layer::setAutoFetchLegendInfos(bool autoFetchLegendInfos)

    Reimplements: LayerContent::setAutoFetchLegendInfos(bool autoFetchLegendInfos).

    Sets whether legend infos are automatically fetched by the layer's legend info list model to autoFetchLegendInfos.

    See LayerContent.

    See also isAutoFetchLegendInfos().

    void Layer::setDescription(const QString &description)

    Sets the layer's description.

    description The description.

    See also description().

    void Layer::setLayerId(const QString &layerId)

    Sets the layer's ID specified in the web map JSON to layerId.

    See also layerId().

    void Layer::setMaxScale(double maxScale)

    Sets the maximum scale (maxScale) at which the layer displays.

    For service layers, this is defined by the service.

    See also maxScale().

    void Layer::setMinScale(double minScale)

    Sets the minimum scale (minScale) at which the layer displays.

    For service layers, this is defined by the service.

    See also minScale().

    void Layer::setName(const QString &name)

    Sets the layer's name.

    The name is defined by the service when the layer initializes, so this method is typically used after the service layer initializes.

    name The name.

    See also name().

    void Layer::setOpacity(float opacity) const

    Sets the opacity of the layer to opacity.

    0.0 is transparent and 1.0 is solid or opaque.

    See also opacity().

    [override virtual] void Layer::setShowInLegend(bool showInLegend)

    Reimplements: LayerContent::setShowInLegend(bool showInLegend).

    Sets whether the layer will be shown in the legend to showInLegend.

    See LayerContent.

    See also isShowInLegend().

    [override virtual] void Layer::setVisible(bool visible)

    Reimplements: LayerContent::setVisible(bool visible).

    Sets whether the layer is visible to visible.

    See LayerContent.

    See also isVisible().

    Esri::ArcGISRuntime::SpatialReference Layer::spatialReference() const

    Gets the spatial reference of the layer.

    [override virtual] QList<Esri::ArcGISRuntime::LayerContent *> Layer::subLayerContents() const

    Reimplements: LayerContent::subLayerContents() const.

    Gets a list of layer contents for any sublayers.

    See LayerContent.

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