Options
All
  • Public
  • Public/Protected
  • All
Menu

This class maintains a vector layer to use for various highlight and overlays.

Hierarchy

  • Highlight

Implements

Index

Constructors

constructor

Methods

animateAndRemove

  • animateAndRemove(source: default | default<default>, style?: InterpolatableStyle | default, duration?: number, easing?: (t: number) => number): Observable<number>
  • Sets a highlight, animates it over the given duration, and then removes it again.

    Parameters

    • source: default | default<default>

      The Feature or Geometry which should be highlighted. The given Feature itself will not be manipulated, but a matching geometry will be created and inserted in the highlight overlay.

    • Optional style: InterpolatableStyle | default

      The style of the highlight. If an InterpolatableStyle is given, the style will be interpolated over the given time, using the given easing.

    • duration: number = 4000

      Time in milliseconds for the animation, before the feature is removed again.

    • easing: (t: number) => number = ...

      The function will be called with values from 0 to 1, and is expected to return eased values in the range 0..1. For this method, the easing should typically ease from 0 to 1 and back down to 0 (such as ballistic, the default) to make the feature fade in and out.

        • (t: number): number
        • Moves from 0 to 1 and back to 0 in a parabolic curve. The inverse of parabolic. This is strictly speaking not an "easing" since it doesn't ease from 0 to 1, but it is useful for temporary highlights.

          Parameters

          • t: number

          Returns number

    Returns Observable<number>

    An Observable emitting numbers from 0 to 1, as per tween. Typically, you will not need to handle the return value, but it can be used to track and synchronize to the animation.

highlight

  • highlight(source: default | default<default>, style?: InterpolatableStyle | default, duration?: number, easing?: (t: number) => number): Observable<number>
  • Sets a highlight and animates it over the given time.

    Parameters

    • source: default | default<default>

      The Feature or Geometry which should be highlighted. The given Feature itself will not be manipulated, but a matching geometry will be created and inserted in the highlight overlay.

    • Optional style: InterpolatableStyle | default

      The style of the highlight. If an InterpolatableStyle is given, the style will be interpolated over the given time, using the given easing.

    • duration: number = 200

      Time in milliseconds for the animation.

    • easing: (t: number) => number = ...

      The function will be called with values from 0 to 1, and is expected to return eased values in the range 0..1. (A function like easeOut can make the feature appear smoothly).

        • (t: number): number
        • Parameters

          • t: number

          Returns number

    Returns Observable<number>

    An Observable emitting numbers from 0 to 1, as per tween. Typically, you will not need to handle the return value, but it can be used to track and synchronize to the animation.

highlightExclusively

  • highlightExclusively(source: default | default<default>, style?: InterpolatableStyle | default, duration?: number): Observable<number>
  • Maintains a single highlight. If highlightExclusively is called again, the existing highlight will be removed. Otherwise, behaves as highlight and remove.

    Parameters

    • source: default | default<default>
    • Optional style: InterpolatableStyle | default
    • duration: number = 200

    Returns Observable<number>

remove

  • remove(source: undefined | null | default | default<default>, duration?: number): void
  • Removes the highlight representing a previously given Feature or Geometry. If the highlight was created with an InterpolatableStyle, the interpolation will be run in reverse before the highlight is removed.

    Parameters

    • source: undefined | null | default | default<default>

      This can be either the originally given Feature, or a Feature from the highlight layer.

    • Optional duration: number

      By default, the animation will run over the same time it did when created, but this can be overriden with this parameter.

    Returns void

removeExclusiveHighlight

  • removeExclusiveHighlight(): void
  • Removes the exclusive highlight, if any. Behaves as remove

    Returns void

setMap