/** * A symbol representing a feature on the map. * * Part of the Esri ArcGIS REST API (see * http://resources.arcgis.com/en/help/rest/apiref/symbol.html). See * {@link https://developers.arcgis.com/web-map-specification/objects/symbol/}. */ export type SymbolJson = Symbol2DJson; /** * Symbol types used in web maps. */ export type Symbol2DJson = SimpleFillSymbolJson | SimpleLineSymbolJson | SimpleMarkerSymbolJson | TextSymbolJson; /** * Color is represented as a four-element array. The four elements represent * values for red, green, blue, and alpha in that order. Values range from 0 * through 255. If color is undefined for a symbol, the color value is null. See * {@link https://developers.arcgis.com/web-map-specification/objects/color/} * {@link https://developers.arcgis.com/web-scene-specification/objects/color/}. */ export type ColorJson = number[]; /** * Font used for text symbols. * * See {@link https://developers.arcgis.com/web-map-specification/objects/font/}. */ export interface FontJson { /** * The font decoration. */ decoration?: "line-through" | "none" | "underline"; /** * The font family. */ family?: string; /** * The font size in points. */ size?: number; /** * The font style. */ style?: "italic" | "normal" | "oblique"; /** * The text weight. */ weight?: "bold" | "bolder" | "lighter" | "normal"; } /** * Base class for all symbols. */ export interface SymbolJsonBase { /** * The type of symbol. See {@link SymbolJsonType}. */ type: SymbolJsonType; } /** * Simple fill symbols can be used to symbolize polygon geometries. * * See * {@link https://developers.arcgis.com/web-map-specification/objects/esriSFS_symbol/}. */ export interface SimpleFillSymbolJson extends SymbolJsonBase { /** * Color is represented as a four-element array. The four elements represent * values for red, green, blue, and alpha in that order. Values range from 0 * through 255. If color is undefined for a symbol, the color value is * null. */ color?: ColorJson; /** * Sets the outline of the fill symbol. */ outline?: SimpleLineSymbolJson; /** * The fill style. */ style?: "esriSFSBackwardDiagonal" | "esriSFSCross" | "esriSFSDiagonalCross" | "esriSFSForwardDiagonal" | "esriSFSHorizontal" | "esriSFSNull" | "esriSFSSolid" | "esriSFSVertical"; /** * @inheritDoc */ type: "esriSFS"; } /** * Simple line symbols can be used to symbolize polyline geometries or outlines * for polygon fills. * * See * {@link https://developers.arcgis.com/web-map-specification/objects/esriSLS_symbol/}. */ export interface SimpleLineSymbolJson extends SymbolJsonBase { /** * Color is represented as a four-element array. The four elements represent * values for red, green, blue, and alpha in that order. Values range from 0 * through 255. If color is undefined for a symbol, the color value is * null. */ color?: ColorJson; /** * The line style. */ style?: "esriSLSDash" | "esriSLSDashDot" | "esriSLSDashDotDot" | "esriSLSDot" | "esriSLSLongDash" | "esriSLSLongDashDot" | "esriSLSLongDashDotDot" | "esriSLSNull" | "esriSLSShortDash" | "esriSLSShortDashDot" | "esriSLSShortDashDotDot" | "esriSLSShortDot" | "esriSLSSolid"; /** * Numeric value indicating the width of the line in pixels. */ width?: number; /** * @inheritDoc */ type: "esriSLS"; } /** * Simple marker symbols can be used to symbolize point geometries. * * See * {@link https://developers.arcgis.com/web-map-specification/objects/esriSMS_symbol/}. */ export interface SimpleMarkerSymbolJson extends SymbolJsonBase { /** * Numeric value used to rotate the symbol. The symbol is rotated * counter-clockwise. For example, The following, angle=-30, in will create * a symbol rotated -30 degrees counter-clockwise; that is, 30 degrees * clockwise. */ angle?: number; /** * Color is represented as a four-element array. The four elements represent * values for red, green, blue, and alpha in that order. Values range from 0 * through 255. If color is undefined for a symbol, the color value is * null. */ color?: ColorJson; /** * Sets the outline of the marker symbol. */ outline?: SimpleLineSymbolJson; /** * Numeric size of the symbol given in pixels. */ size?: number; /** * The marker style. */ style?: "esriSMSCircle" | "esriSMSCross" | "esriSMSDiamond" | "esriSMSSquare" | "esriSMSX" | "esriSMSTriangle"; /** * Numeric value indicating the offset on the x-axis in pixels. */ xoffset?: number; /** * Numeric value indicating the offset on the y-axis in pixels. */ yoffset?: number; /** * @inheritDoc */ type: "esriSMS"; } /** * Text symbols are used to add text to a feature (labeling). * * See * {@link https://developers.arcgis.com/web-map-specification/objects/esriTS_symbol/}. */ export interface TextSymbolJson extends SymbolJsonBase { /** * A numeric value that defines the number of degrees (0 to 360) that a text * symbol is rotated. The rotation is from East in a counter-clockwise * direction where East is the 0° axis. */ angle?: number; /** * Background color of the text. */ backgroundColor?: ColorJson; /** * Value indicating the the color of the border line. */ borderLineColor?: ColorJson; /** * Numeric value indicating the the size of the border line in points. */ borderLineSize?: number; /** * Color is represented as a four-element array. The four elements represent * values for red, green, blue, and alpha in that order. Values range from 0 * through 255. If color is undefined for a symbol, the color value is * null. */ color?: ColorJson; /** * Font used for text symbols. */ font?: FontJson; /** * Color of the halo around the text. */ haloColor?: ColorJson; /** * Numeric value indicating the point size of a halo around the text symbol. */ haloSize?: number; /** * The horizontal alignment of the text. */ horizontalAlignment?: "left" | "right" | "center" | "justify"; /** * Boolean value indicating whether to adjust the spacing between characters * in the text string. */ kerning?: boolean; /** * Boolean value, set to true if using Hebrew or Arabic fonts. */ rightToLeft?: boolean; /** * Boolean value indicating whether every character in the text string is * rotated. */ rotated?: boolean; /** * Only applicable when specified as a client-side graphic. */ text?: string; /** * The vertical alignment of the text. */ verticalAlignment?: "baseline" | "top" | "middle" | "bottom"; /** * Numeric value indicating the offset on the x-axis in pixels. */ xoffset?: number; /** * Numeric value indicating the offset on the y-axis in pixels. */ yoffset?: number; /** * @inheritDoc */ type: "esriTS"; } /** * The type of the Symbol. */ export type SymbolJsonType = "esriSMS" | "esriSLS" | "esriSFS" | "esriPMS" | "esriPFS" | "esriTS" | "LineSymbol3D" | "MeshSymbol3D" | "PointSymbol3D" | "PolygonSymbol3D" | "LabelSymbol3D" | "styleSymbolReference" | "CIMSymbolReference";