SnapSourceSettings Class

  • SnapSourceSettings
  • class Esri::ArcGISRuntime::SnapSourceSettings

    Configures a valid source of geometries that the GeometryEditor can snap interactive edits to. More...

    Header: #include <SnapSourceSettings.h>
    Since: Esri::ArcGISRuntime 200.4
    Inherits: Esri::ArcGISRuntime::Object

    Public Functions

    virtual ~SnapSourceSettings() override
    (since Esri::ArcGISRuntime 200.7) QList<Esri::ArcGISRuntime::SnapSourceSettings *> childSourceSettings() const
    bool isEnabled() const
    (since Esri::ArcGISRuntime 200.7) Esri::ArcGISRuntime::SnapRuleBehavior ruleBehavior() const
    void setEnabled(bool enabled)
    Esri::ArcGISRuntime::SnapSource *source() const

    Detailed Description

    Following a call to SnapSettings::syncSourceSettings, the SnapSettings::sourceSettings collection is populated with SnapSourceSettings objects that are valid for snapping. Each represents a SnapSource that is in the currently connected map and provides full resolution geometries suitable for snapping.

    Set isEnabled to true for each item that you want allow your users to snap to. You may wish to delegate the choice of snapping sources to users by binding the collection of snapping sources to controls which allow them to change isEnabled for each snapping source individually.

    Snapping works for visible objects within a visible SnapSource - for example if a feature layer or graphics overlay is not visible due to the current scale range, definition expression, or other reason, it will not participate in snapping at that time. Visibility does not affect whether a SnapSourceSettings object is present in the SnapSettings::sourceSettings collection or not.

    See SnapSource for more information about which data sources are valid for snapping.

    Relevant samples:

    • Snap geometry edits: Use the Geometry Editor to edit a geometry and align it to existing geometries on a map.

    See also SnapSettings and SnapSource.

    Member Function Documentation

    [override virtual noexcept] SnapSourceSettings::~SnapSourceSettings()

    Destructor.

    [since Esri::ArcGISRuntime 200.7] QList<Esri::ArcGISRuntime::SnapSourceSettings *> SnapSourceSettings::childSourceSettings() const

    Returns a collection of SnapSourceSettings objects representing the child snap sources of source, when the snap source is a SubtypeFeatureLayer.

    When this snap source is a SubtypeFeatureLayer, this collection contains a SnapSourceSettings object corresponding to each SubtypeSublayer of that layer, in the same order as the SubtypeFeatureLayer::subtypeSublayers collection.

    This collection is empty when the source is not a SubtypeFeatureLayer.

    This function was introduced in Esri::ArcGISRuntime 200.7.

    bool SnapSourceSettings::isEnabled() const

    Returns true to enable snapping to the geometries in the SnapSource, false otherwise. Default is false.

    Snapping sources can be enabled or disabled individually. If SnapSettings::isEnabled is false, this value is ignored and snapping is not enabled.

    See also SnapSettings.

    [since Esri::ArcGISRuntime 200.7] Esri::ArcGISRuntime::SnapRuleBehavior SnapSourceSettings::ruleBehavior() const

    Returns how SnapRules affect the interactive snapping behavior of this SnapSourceSettings.

    This value indicates how interactive snapping behavior is affected by SnapRules, which may allow, limit, or prevent snapping to this SnapSourceSettings. Rule-based snapping is configured by calling SnapSettings::syncSourceSettings(SnapRules*, SnapSourceEnablingBehavior) - see SnapRules for more information about configuring a GeometryEditor with rule-based snapping.

    If rule-based snapping is not configured (if snap sources were synchronized by calling SnapSettings::syncSourceSettings), then this value will be SnapRuleBehavior::None for all SnapSourceSettings in the SnapSettings::sourceSettings collection.

    This information can be used to provide UI feedback to end users about which SnapSourceSettings can be snapped to. For example if your app presents a list of snap sources to the end user to enable or disable, you may wish to exclude SnapRuleBehavior::RulesPreventSnapping snap sources because they cannot actually be snapped to, regardless of the value of isEnabled.

    This function was introduced in Esri::ArcGISRuntime 200.7.

    See also SnapRules.

    void SnapSourceSettings::setEnabled(bool enabled)

    Sets the enabled to enabled.

    See also isEnabled.

    Esri::ArcGISRuntime::SnapSource *SnapSourceSettings::source() const

    Returns underlying source of geometries to snap to, for example a FeatureLayer, SubtypeFeatureLayer, SubtypeSublayer, or GraphicsOverlay.

    See also SnapSettings.

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