SubtypeFeatureLayer Class

  • SubtypeFeatureLayer
  • class Esri::ArcGISRuntime::SubtypeFeatureLayer

    A layer that can visualize feature data with different visibility, rendering, popup properties, and so on for some or all of the FeatureSubtype in an ArcGISFeatureTable. More...

    Header: #include <SubtypeFeatureLayer.h>
    Since: Esri::ArcGISRuntime 100.7
    Inherits: Esri::ArcGISRuntime::FeatureLayer

    This class was introduced in Esri::ArcGISRuntime 100.7.

    Public Functions

    SubtypeFeatureLayer(Esri::ArcGISRuntime::Item *item, qint64 layerId, QObject *parent = nullptr)
    SubtypeFeatureLayer(Esri::ArcGISRuntime::ArcGISFeatureTable *featureTable, QObject *parent = nullptr)
    virtual ~SubtypeFeatureLayer() override
    Esri::ArcGISRuntime::SubtypeSublayer *sublayerWithSubtypeCode(const QVariant &code, QObject *parent = nullptr) const
    Esri::ArcGISRuntime::SubtypeSublayer *sublayerWithSubtypeName(const QString &name, QObject *parent = nullptr) const
    Esri::ArcGISRuntime::SubtypeSublayerListModel *subtypeSublayers() const

    Detailed Description

    The ArcGISFeatureTable must have a ArcGISFeatureLayerInfo::subtypeField defined, and at least one FeatureSubtype defined; otherwise the layer will fail to load.

    Subtypes provide a way to organize your data within an ArcGIS feature table. For example, the streets in a city-streets feature table could be categorized into three subtypes: local streets, collector streets, and arterial streets. The benefit of the subtype feature layer is that it lets you configure different layer properties per subtype. This is particularly useful for data, such as utility networks, in which many different network elements are grouped into a single subtype feature layer.

    Functional characteristics

    The subtype feature layer acts like a group layer that automatically creates one feature layer, or subtype sublayer, for each subtype in the table. Each subtype sublayer can be configured independently of one another. They can have different renderers, label definitions, max and min scales, visibility, layer order in the map, and so on. When a subtype group layer is read from a web map or mobile map, it is represented as a SubtypeFeatureLayer. Saving a map that contains a SubtypeFeatureLayer will save the layer as a subtype group layer. Subtype feature layers are supported in offline maps and will work in offline editing workflows.

    Performance characteristics

    Queries are optimized across all sublayers. For example, a pan of the map sends a single request to the feature table to cover all the sublayers. If you had manually created a feature layer for each subtype, this would have resulted in one query per feature layer.

    See sample: Display subtype feature layer

    See also FeatureLayer.

    Member Function Documentation

    SubtypeFeatureLayer::SubtypeFeatureLayer(Esri::ArcGISRuntime::Item *item, qint64 layerId, QObject *parent = nullptr)

    Creates a new subtype feature layer object from a feature service portal item.

    • item - A feature service PortalItem.
    • layerId - The layer id for which to create the layer.
    • parent - The optional parent QObject.

    This function was introduced in Esri::ArcGISRuntime 100.12.

    See also Layer::item.

    SubtypeFeatureLayer::SubtypeFeatureLayer(Esri::ArcGISRuntime::ArcGISFeatureTable *featureTable, QObject *parent = nullptr)

    Creates a new subtype feature layer object.

    If are there no ArcGISFeatureTable::featureSubtypes objects defined on the ArcGISFeatureTable, the layer will fail to load.

    • featureTable - The feature table used as the source of the subtype feature layer.
    • parent - an optional parent QObject.

    [override virtual] SubtypeFeatureLayer::~SubtypeFeatureLayer()

    Destructor.

    Esri::ArcGISRuntime::SubtypeSublayer *SubtypeFeatureLayer::sublayerWithSubtypeCode(const QVariant &code, QObject *parent = nullptr) const

    Finds a SubtypeSublayer for a feature subtype based on the FeatureSubtype::code.

    When working with a particular ArcGISFeature, the FeatureSubtype::code is the value of the ArcGISFeatureLayerInfo::subtypeField field. The corresponding SubtypeSublayer can be found using the value of that field. Returns the SubtypeSublayer of the subtype code.

    • code - The subtype code of the sublayer to retrieve.
    • parent - An optional parent.

    If parent is nullptr, then this object will be the parent.

    See also Returned QObjects Parenting.

    Esri::ArcGISRuntime::SubtypeSublayer *SubtypeFeatureLayer::sublayerWithSubtypeName(const QString &name, QObject *parent = nullptr) const

    Finds a SubtypeSublayer for a feature subtype based on the subtype name.

    • name - The subtype name of the sublayer to retrieve.
    • parent - An optional parent.

    If parent is nullptr, then this object will be the parent.

    See also Returned QObjects Parenting.

    Esri::ArcGISRuntime::SubtypeSublayerListModel *SubtypeFeatureLayer::subtypeSublayers() const

    Returns the list model of SubtypeSublayer in the SubtypeFeatureLayer.

    The objects in this collection are the same objects in LayerContent::subLayerContents. The difference between the two collections is this collection is modifiable so the layer order is configurable.

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