UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

116 lines (114 loc) 3.65 kB
import type Color from "../Color.js"; import type { Clonable } from "../core/Clonable.js"; import type { JSONSupportMixin } from "../core/JSONSupport.js"; import type { ColorLike } from "../Color.js"; export interface DimensionSimpleStyleProperties { /** * Color of dimension lines. * * @default "black" */ color?: ColorLike; /** * Size of text in dimension labels in points. This value may be autocast with a string * expressing size in points or pixels (e.g. `12px`). * * @default 10 */ fontSize?: number | string; /** * Width of dimension lines in points. This value may be autocast with a string * expressing size in points or pixels (e.g. `12px`). * * @default 2 */ lineSize?: number | string; /** * Background color of dimension labels. * * @default [255, 255, 255, 0.6] */ textBackgroundColor?: ColorLike; /** * Color of text in dimension labels. * * @default "black" */ textColor?: ColorLike; } /** * Style that specifies how dimensions and their labels are displayed. * * The simple style is either set on a [DimensionAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/DimensionAnalysis/) or on a * [DimensionLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionLayer/) and applies to all [dimensions](https://developers.arcgis.com/javascript/latest/references/core/analysis/LengthDimension/) * added to them. * * ```js * // create analysis with dimensions * const dimensionAnalysis = new DimensionAnalysis({ * dimensions: [ * new LengthDimension({ * startPoint: new Point({ }), * endPoint: new Point({ }) * }) * ], * style: new DimensionSimpleStyle({ * color: "white", * lineSize: 1.5, * textBackgroundColor: "white", * textColor: "black", * fontSize: 9 * }), * }); * // add the analysis to the view * view.analyses.add(dimensionAnalysis); * ``` * * @since 4.25 * @see [DimensionAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/DimensionAnalysis/) * @see [LengthDimension](https://developers.arcgis.com/javascript/latest/references/core/analysis/LengthDimension/) * @see [DimensionLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionLayer/) * @see [Sample - Length dimensioning](https://developers.arcgis.com/javascript/latest/sample-code/layers-dimension/) */ export default class DimensionSimpleStyle extends DimensionSimpleStyleSuperclass { constructor(properties?: DimensionSimpleStyleProperties); /** * Color of dimension lines. * * @default "black" */ get color(): Color; set color(value: ColorLike); /** * Size of text in dimension labels in points. This value may be autocast with a string * expressing size in points or pixels (e.g. `12px`). * * @default 10 */ get fontSize(): number; set fontSize(value: number | string); /** * Width of dimension lines in points. This value may be autocast with a string * expressing size in points or pixels (e.g. `12px`). * * @default 2 */ get lineSize(): number; set lineSize(value: number | string); /** * Background color of dimension labels. * * @default [255, 255, 255, 0.6] */ get textBackgroundColor(): Color; set textBackgroundColor(value: ColorLike); /** * Color of text in dimension labels. * * @default "black" */ get textColor(): Color; set textColor(value: ColorLike); get type(): "simple"; } declare const DimensionSimpleStyleSuperclass: typeof Clonable & typeof JSONSupportMixin