@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
146 lines (144 loc) • 4.95 kB
TypeScript
import type Accessor from "../../core/Accessor.js";
import type CreateToolVisibilityMap from "./CreateToolVisibilityMap.js";
import type SelectionToolVisibilityMap from "./SelectionToolVisibilityMap.js";
import type SnappingControlsVisibleElements from "../support/SnappingControls/VisibleElements.js";
import type { CreateToolVisibilityMapProperties } from "./CreateToolVisibilityMap.js";
import type { SelectionToolVisibilityMapProperties } from "./SelectionToolVisibilityMap.js";
import type { SnappingControlsVisibleElementsProperties } from "../support/SnappingControls/VisibleElements.js";
/** @since 5.0 */
export interface VisibleElementsProperties extends Partial<Pick<VisibleElements, "deleteButton" | "duplicateButton" | "labelsToggle" | "selectionCountLabel" | "settingsMenu" | "snappingControls" | "tooltipsToggle" | "undoRedoMenu">> {
/**
* The available sketch tools within the widget.
*
* @since 5.0
*/
createTools?: CreateToolVisibilityMapProperties;
/**
* The available selection tools within the widget.
* > [!WARNING]
* >
* > **Known Limitation**
* >
* > Rectangle and lasso selection is only supported when working with a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/).
*
* @since 5.0
*/
selectionTools?: SelectionToolVisibilityMapProperties;
/**
* The available [SnappingControls](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SnappingControls/) elements within the widget.
*
* @since 5.0
*/
snappingControlsElements?: SnappingControlsVisibleElementsProperties;
}
/**
* The visible elements that are displayed within the widget.
* This provides the ability to turn individual elements of the widget's display on/off.
*
* @since 5.0
* @example
* // This hides the lasso selection tools
* sketch.visibleElements = {
* selectionTools: {
* "lasso-selection": false
* }
* }
* @example
* // This removes the feature enabled snapping toggle and the layerlist.
* sketch.visibleElements = {
* snappingControlsElements: {
* featureEnabledToggle: false,
* layerList: false
* }
* }
* @example
* // This hides the undo/redo tools
* sketch.visibleElements = {
* undoRedoMenu: false
* }
*/
export default class VisibleElements extends Accessor {
constructor(properties?: VisibleElementsProperties);
/**
* The available sketch tools within the widget.
*
* @since 5.0
*/
get createTools(): CreateToolVisibilityMap;
set createTools(value: CreateToolVisibilityMapProperties);
/**
* Indicates whether to display the 'delete' button while a graphic is selected. Default is `true`. Do not hide this button without giving users on touch devices another way to delete selected geometries.
*
* @default true
* @since 5.0
*/
accessor deleteButton: boolean;
/**
* Indicates whether to display the 'duplicate' button while a graphic is selected. Default is `true`.
*
* @default true
* @since 5.0
*/
accessor duplicateButton: boolean;
/**
* Indicates whether to display the sketch labels toggle. Default value is `true`.
*
* @default true
* @since 5.0
*/
accessor labelsToggle: boolean;
/**
* Indicates whether to display a label indicating the length of the currently selected feature set.
*
* @default true
* @since 5.0
*/
accessor selectionCountLabel: boolean;
/**
* The available selection tools within the widget.
* > [!WARNING]
* >
* > **Known Limitation**
* >
* > Rectangle and lasso selection is only supported when working with a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/).
*
* @since 5.0
*/
get selectionTools(): SelectionToolVisibilityMap;
set selectionTools(value: SelectionToolVisibilityMapProperties);
/**
* Indicates whether to display the settings menu. Currently this menu contains snapping options. Default value is `true`.
*
* @default true
* @since 5.0
*/
accessor settingsMenu: boolean;
/**
* Indicates whether to display the `SnappingControls` widget. Default is `true`.
*
* @default true
* @since 5.0
*/
accessor snappingControls: boolean;
/**
* The available [SnappingControls](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SnappingControls/) elements within the widget.
*
* @since 5.0
*/
get snappingControlsElements(): SnappingControlsVisibleElements;
set snappingControlsElements(value: SnappingControlsVisibleElementsProperties);
/**
* Indicates whether to display the tooltips toggle. Default value is `true`.
*
* @default true
* @since 5.0
*/
accessor tooltipsToggle: boolean;
/**
* Indicates whether to display the undo/redo menu within the widget. Default is `true`.
*
* @default true
* @since 5.0
*/
accessor undoRedoMenu: boolean;
}