Skip To Content ArcGIS for Developers Sign In Dashboard

Layer Class

(Esri::ArcGISRuntime::Layer)

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

Public Functions

~Layer()
QString attribution() const
QString description() const
Envelope fullExtent() const
bool isIdentifyEnabled() const
Item *item() const
QString layerId() const
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
SpatialReference spatialReference() const

Reimplemented Public Functions

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

Signals

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

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

Represents a layer that displays data on a map.

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

Layer is the base class for many types of layers. Each layer type is designed for a certain type of data source, display characteristic, or behavior.

Member Function Documentation

Layer::~Layer()

Destructor.

QString Layer::attribution() const

Gets the layer's attribution if any is available.

[virtual] bool Layer::canChangeVisibility() const

Reimplemented from LayerContent::canChangeVisibility().

Returns whether the layer's visibility can be changed.

See LayerContent.

[virtual] void Layer::cancelLoad()

Reimplemented from 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().

[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.

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.

[virtual] bool Layer::isAutoFetchLegendInfos() const

Reimplemented from LayerContent::isAutoFetchLegendInfos().

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.

[virtual] bool Layer::isShowInLegend() const

Reimplemented from LayerContent::isShowInLegend().

Returns whether the layer will be shown in the legend.

See LayerContent.

[virtual] bool Layer::isVisible() const

Reimplemented from LayerContent::isVisible().

Returns whether the layer is enabled to be visible.

See LayerContent.

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

Reimplemented from LayerContent::isVisibleAtScale().

Returns whether the sublayer is visible at a given scale.

See LayerContent.

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().

LayerType Layer::layerType() const

Gets the layer's type.

[virtual] LegendInfoListModel *Layer::legendInfos() const

Reimplemented from LayerContent::legendInfos().

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

See LayerContent.

[virtual] void Layer::load()

Reimplemented from Loadable::load().

See Loadable.

[virtual] Error Layer::loadError() const

Reimplemented from Loadable::loadError().

See Loadable.

[virtual] LoadStatus Layer::loadStatus() const

Reimplemented from Loadable::loadStatus().

See Loadable.

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

Signal emitted when the loadStatus changes for this object.

See also 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().

[virtual] QString Layer::name() const

Reimplemented from LayerContent::name().

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().

[virtual] void Layer::retryLoad()

Reimplemented from Loadable::retryLoad().

See Loadable.

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

Reimplemented from LayerContent::setAutoFetchLegendInfos().

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().

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

Reimplemented from LayerContent::setShowInLegend().

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

See LayerContent.

See also isShowInLegend().

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

Reimplemented from LayerContent::setVisible().

Sets whether the layer is visible to visible.

See LayerContent.

See also isVisible().

SpatialReference Layer::spatialReference() const

Gets the spatial reference of the layer.

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

Reimplemented from LayerContent::subLayerContents().

Gets a list of layer contents for any sublayers.

See LayerContent.


Feedback on this topic?