A control for editing and managing style settings for WxColorStyle. This class provides an interface for manipulating various style properties, including colors, vectors, streamlines, and other visual aspects for a weather visualization.

Hierarchy

  • WxStyleEditorControl

Constructors

Properties

addDegreesInput: HTMLInputElement

Input for add degrees

animationIntensity: HTMLInputElement

Input for animation intensity

animationSpeed: HTMLInputElement

Input for animation speed

blurRadiusInput: HTMLInputElement

Input for blur radius

colorMapInput: HTMLInputElement

Input for color map

colorSchemeSelect: HTMLSelectElement

Dropdown select for color scheme

colorsInput: HTMLInputElement

Input for colors

editorDivEl: HTMLDivElement
editorTextAreaEl: HTMLTextAreaElement
extraUnitsInput: HTMLInputElement

Input for extra units

fillSelect: HTMLSelectElement

Dropdown select for fill style

isolineColorInput: HTMLInputElement

Input for isoline color

isolineColorSelect: HTMLSelectElement

Dropdown select for isoline color

isolineTextInput: HTMLInputElement

Input for isoline text visibility

levelsInput: HTMLInputElement

Input for levels

maskSelect: HTMLSelectElement

Dropdown select for mask

nameInput: HTMLInputElement

Input for the name of the style

noiseTexturePow: HTMLInputElement

Input for noise texture power

onchange?: ((style: WxColorStyleWeak, nonnative?: boolean) => Promise<void>)

Type declaration

    • (style: WxColorStyleWeak, nonnative?: boolean): Promise<void>
    • Event handler triggered when style changes. This handler is expected to return a promise for async operations.

      Parameters

      • style: WxColorStyleWeak

        The updated style to apply.

      • Optional nonnative: boolean

        Optional flag for non-native style handling.

      Returns Promise<void>

parent: HTMLDivElement

Main container for the editor

parentInput: HTMLInputElement

Input for the parent of the style

showAboveMaxInput: HTMLInputElement

Input for show above max

showBelowMinInput: HTMLInputElement

Input for show below min

streamLineColorInput: HTMLInputElement

Input for stream line color

streamLineColorSelect: HTMLSelectElement

Dropdown select for stream line color

streamLineSpeedFactorInput: HTMLInputElement

Input for stream line speed factor

streamLineStaticInput: HTMLInputElement

Input for stream line static

styleBase: WxColorStyleStrict

Base style for WxColorStyle

unitsInput: HTMLInputElement

Input for units

vectorColorInput: HTMLInputElement

Input for vector color

vectorColorSelect: HTMLSelectElement

Dropdown select for vector color

vectorFactorInput: HTMLInputElement

Input for vector factor (strength)

vectorFieldFactor: HTMLInputElement

Input for vector field factor

vectorTypeSelect: HTMLSelectElement

Dropdown select for vector type

wavesCount: HTMLInputElement

Input for waves count

Methods

  • Sets the style of the control.

    This method applies a given WxColorStyleWeak style to the control. If the style includes a colorMap, it filters out colors and levels before applying the style to the control. The style is then set to the control's div and reflected in the text area using the _setStyleToTextArea method.

    Returns WxColorStyleWeak

  • Handles changes made to the control's div and updates the style.

    This method retrieves the current style from the div, removes any properties that are undefined, empty, or have a length of zero, and updates the text area with the modified style. Afterward, it calls the onchange callback (if defined) with the updated style.

    Returns void

  • Sets the style to the editor's text area.

    This method serializes the given WxColorStyleWeak style into a sorted JSON string and sets it as the value of the editor's text area. The style is sorted using the JSONsort function before being applied.

    Parameters

    • style: WxColorStyleWeak

      The WxColorStyleWeak object representing the style to be set in the text area.

    Returns void

  • Returns an object with methods to add and remove the control from a map.

    This method is used to integrate the control into map libraries that require onAdd and onRemove methods, such as Leaflet or Mapbox.

    Returns

    An object with two methods:

    • onAdd: Adds the control to the map.
    • onRemove: Removes the control from the map.

    Returns {
        onAdd: (() => HTMLDivElement);
        onRemove: (() => void);
    }

    • onAdd: (() => HTMLDivElement)
        • (): HTMLDivElement
        • Returns HTMLDivElement

    • onRemove: (() => void)
        • (): void
        • Returns void

  • Retrieves the current style of the control.

    This method calls a private method _getStyleFromDiv to get the style from the control's div element. It returns the style as a WxColorStyleWeak object, which represents the current styling properties.

    Returns

    The current style of the control as a WxColorStyleWeak object.

    Returns WxColorStyleWeak

Generated using TypeDoc