@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
108 lines (106 loc) • 4.49 kB
TypeScript
import type Accessor from "../../../core/Accessor.js";
import type GridControlsVisibleElements from "../GridControls/VisibleElements.js";
import type { VisibleElementsProperties } from "../GridControls/VisibleElements.js";
/** @since 5.0 */
export interface SnappingControlsVisibleElementsProperties extends Partial<Pick<SnappingControlsVisibleElements, "enabledToggle" | "featureEnabledToggle" | "gridControls" | "gridEnabledToggle" | "header" | "layerList" | "layerListToggleLayersButton" | "selfEnabledToggle">> {
/**
* The available [GridControls](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/GridControls/) elements within the widget.
*
* @since 5.0
*/
gridControlsElements?: VisibleElementsProperties;
}
/**
* The visible elements that are displayed within the widget.
* This provides the ability to toggle visibility for individual elements within the widget.
*
* @since 5.0
* @example
* // Setting visibleElements on SnappingControls
* const snappingControls = new SnappingControls({
* view,
* visibleElements: {
* selfEnabledToggle: false,
* gridControlsElements: {
* colorSelection: false,
* gridEnabledToggle: false
* }
* }
* });
*/
export default class SnappingControlsVisibleElements extends Accessor {
constructor(properties?: SnappingControlsVisibleElementsProperties);
/**
* Indicates whether to display the `enabledToggle` (Enable snapping). Default is `true`. This toggles
* the [SnappingOptions.enabled](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/#enabled) property.
* > [!WARNING]
* >
* > **Note**
* >
* > It is recommended to set `SnappingControls.snappingOptions.enabled = true` if `enabledToggle` is set to `false`.
* > This is because `selfEnabledToggle` and `featureEnabledToggle` require snapping globally to be enabled in order to be interactive. Otherwise, these toggles will not be responsive.
*
* @default true
* @since 5.0
*/
accessor enabledToggle: boolean;
/**
* Indicates whether to display the `featureEnabledToggle` (Feature to feature). Default is `true`. This toggles
* the [SnappingOptions.featureEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/#featureEnabled) property.
*
* @default true
* @since 5.0
*/
accessor featureEnabledToggle: boolean;
/**
* Indicates whether to display the grid controls widget embedded in snapping controls. Default is `true`.
*
* @default true
* @since 5.0
*/
accessor gridControls: boolean;
/**
* The available [GridControls](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/GridControls/) elements within the widget.
*
* @since 5.0
*/
get gridControlsElements(): GridControlsVisibleElements;
set gridControlsElements(value: VisibleElementsProperties);
/**
* Indicates whether to display the grid display toggle embedded in grid controls. Default is `true`.
*
* @default true
* @since 5.0
*/
accessor gridEnabledToggle: boolean;
/**
* Indicates whether to display the header. Default is `false`.
*
* @default false
* @since 5.0
*/
accessor header: boolean;
/**
* Indicates whether to display the [FeatureSnappingLayerSource](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/FeatureSnappingLayerSource/) layerList. Default is `true`. The layerlist provides the available layer sources supported for snapping.
*
* @default true
* @since 5.0
*/
accessor layerList: boolean;
/**
* Indicates whether to display the “Enable all” or “Disable all” button to enable / disable snapping for all the layers in the list.
* 
*
* @default true
* @since 5.0
*/
accessor layerListToggleLayersButton: boolean;
/**
* Indicates whether to display the `selfEnabledToggle` (Geometry guides). Default is `true`. This toggles
* the [SnappingOptions.selfEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/#selfEnabled) property.
*
* @default true
* @since 5.0
*/
accessor selfEnabledToggle: boolean;
}