Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "geocortex/infrastructure/SymbolUtils"

Index

Type aliases

SimpleOutlinedSymbol

SimpleOutlinedSymbol: SimpleMarkerSymbol | SimpleFillSymbol

Common attributes for SimpleMarker and SimpleFill symbols

SimpleSymbol

Common attributes for SimpleMarker, SimpleLine and SimpleFill symbols

Variables

Const POINTS_TO_PIXELS

POINTS_TO_PIXELS: number

The size values in a renderer JSON object need to be converted from points to pixels in order to be able to recreate the same renderer using the JSAPI. 96dpi is assumed and there are 72 points in an inch.

Let defaultPointMarkup

defaultPointMarkup: SimpleMarkerSymbol

Default markup symbols.

Let defaultPolygonMarkup

defaultPolygonMarkup: SimpleFillSymbol

Let defaultPolylineMarkup

defaultPolylineMarkup: SimpleLineSymbol

Let defaultTextMarkup

defaultTextMarkup: TextSymbol

Functions

createSymbolSwatch

  • createSymbolSwatch(div: HTMLElement, size: number, symbol: Symbol): void
  • Create an SVG swatch that displays a preview of the given symbol

    Parameters

    • div: HTMLElement

      The div to attach the swatch to

    • size: number

      The size of the swatch

    • symbol: Symbol

      The esri.symbol.Symbol to create a swatch for

    Returns void

createTextSymbolSwatch

  • createTextSymbolSwatch(div: HTMLElement, size: number, symbol: TextSymbol, graphicsLayer: GraphicsLayer): void
  • Create an SVG swatch that displays a preview of the given symbol

    Parameters

    • div: HTMLElement

      The div to attach the swatch to

    • size: number

      The size of the swatch

    • symbol: TextSymbol

      The esri.symbol.TextSymbol to create a swatch for

    • graphicsLayer: GraphicsLayer

      The graphicsLayer used to draw the halo. Not altered in any way.

    Returns void

defaultFillSymbol

  • defaultFillSymbol(): SimpleFillSymbol
  • Returns the ESRI default fill symbol

    Returns SimpleFillSymbol

defaultLineSymbol

  • defaultLineSymbol(): SimpleLineSymbol
  • Returns the ESRI default line symbol

    Returns SimpleLineSymbol

defaultMarkerSymbol

  • defaultMarkerSymbol(): SimpleMarkerSymbol
  • Returns the ESRI default marker symbol

    Returns SimpleMarkerSymbol

defaultMarkupSymbol

  • defaultMarkupSymbol(symbolType: string): Symbol
  • Returns the default markup symbol These may be changed by the configuration of the MarkupModule, though they do not depend on it.

    Parameters

    • symbolType: string

    Returns Symbol

defaultSymbol

  • defaultSymbol(symbolType: string): Symbol
  • Returns a default symbol

    Parameters

    • symbolType: string

    Returns Symbol

defaultSymbolColor

  • defaultSymbolColor(options?: object): Color
  • Returns default color. If any modifications are provided, we will return a color with those modifications made

    Parameters

    • Optional options: object
      • Optional a?: number
      • Optional b?: number
      • Optional g?: number
      • Optional r?: number

    Returns Color

defaultTextSymbol

  • defaultTextSymbol(disableHalo?: boolean): TextSymbol
  • Returns the ESRI default text symbol

    Parameters

    • Optional disableHalo: boolean

    Returns TextSymbol

esriSymbolsEqual

  • esriSymbolsEqual(a: Symbol, b: Symbol): boolean
  • Parameters

    • a: Symbol
    • b: Symbol

    Returns boolean

fromEsriSymbolType

  • fromEsriSymbolType(type: string): string
  • Convert from the 'type' propety of an esri.symbol.Symbol to the SymbolType string values

    Parameters

    • type: string

    Returns string

getEssentialsSymbolLibrary

  • getEssentialsSymbolLibrary(symbolLibraryUrl: string): Promise<any>
  • Gets the symbol libraries from the essentials symbol endpoint. Caches responses so we request a particular library only once.

    Parameters

    • symbolLibraryUrl: string

      The url for the essentials symbol library.

    Returns Promise<any>

    The library object from Essentials.

getPointSizeFromRenderer

  • getPointSizeFromRenderer(renderer: any): number
  • Given a simple, unique value, or class breaks based renderer returns the symbol size in points. Note that if the class breaks or unique value renderer defines classes with different symbol sizes, this will return the size of the first class. Does not account for visual variables.

    Parameters

    • renderer: any

    Returns number

layerFeatureTypeToSymbolType

  • layerFeatureTypeToSymbolType(type: string): string
  • Convert from the 'featureType' string stored in the layer object to a SymbolType

    Parameters

    • type: string

      A layer.featureType string

    Returns string

rotate

  • rotate(cx: number, cy: number, x: number, y: number, angle: number): object
  • Rotate a point around an origin

    Parameters

    • cx: number

      origin x

    • cy: number

      origin y

    • x: number

      point x

    • y: number

      point y

    • angle: number

      rotation angle

    Returns object

    • x: number
    • y: number

setDefaultPointMarkup

  • setDefaultPointMarkup(symbol: SimpleMarkerSymbol): void
  • Parameters

    • symbol: SimpleMarkerSymbol

    Returns void

setDefaultPolygonMarkup

  • setDefaultPolygonMarkup(symbol: SimpleFillSymbol): void
  • Parameters

    • symbol: SimpleFillSymbol

    Returns void

setDefaultPolylineMarkup

  • setDefaultPolylineMarkup(symbol: SimpleLineSymbol): void
  • Parameters

    • symbol: SimpleLineSymbol

    Returns void

setDefaultTextMarkup

  • setDefaultTextMarkup(symbol: TextSymbol): void
  • Parameters

    • symbol: TextSymbol

    Returns void

stringToHash

  • stringToHash(input: string): number

webMapAngleToJSAPIAngle

  • webMapAngleToJSAPIAngle(angle: number): number
  • Angles are stored differently in ESRI's webMap or REST API symbol representation This converts from the webMap variant to JSAPI

    Parameters

    • angle: number

    Returns number