C

WebGLZoomVisibilityPolicy

Fades out items for certain zoom levels when rendering in WebGL mode.
Inheritance Hierarchy

Remarks

When set on a WebGL style, instances of this class will fade out items with this style when the zoom level is below lowerThreshold or above upperThreshold.

The transition between the states is animated and can be configured with transitionDuration and transitionEasing.

The behavior can be turned on and off with start and stop. The behavior is initially enabled.

Instances of this class count toward the global animation limits, each instance requiring one animation slot. Therefore, instances should be shared between items and styles.

See Also

API

zoomVisibilityPolicy, zoomVisibilityPolicy, zoomVisibilityPolicy, zoomVisibilityPolicy, zoomVisibilityPolicy, zoomVisibilityPolicy, zoomVisibilityPolicy, zoomVisibilityPolicy, createFadeAnimation

Demos

Shows how to achieve a simple level of detail effect by fading in/out labels at a certain zoom value using WebGL rendering.

Members

No filters for this type

Constructors

Creates a new policy for hiding items depending on the current zoom level with the specified parameters.
Instances of this class count toward the global animation limits, each instance requiring one animation slot. Therefore, instances should be shared between items and styles.

Parameters

lowerThreshold?: number
Items are visible above this zoom threshold. Defaults to 1. See lowerThreshold.
upperThreshold?: number
Items are visible below this zoom threshold. Defaults to positive infinity, so items are always visible above the lower threshold. See lowerThreshold.
transitionDuration?: TimeSpan
conversion
The duration of the fade transition. Defaults to one second. See transitionDuration.
transitionEasing?: WebGLAnimationEasing
conversion
The easing of the fade transition. Defaults to no easing. See transitionEasing.

Properties

Gets the lower zoom threshold, above which items are visible.
Items are visible if CanvasComponent.zoom is at or above this threshold. Must be zero or positive and lower than upperThreshold. Set to 0 to make items always visible below upperThreshold.
readonlyfinal
Gets the transition duration when fading between visible and invisible states.
readonlyfinal
Gets the transition easing when fading between visible and invisible states.
readonlyfinal
Gets the upper zoom threshold, below which items are visible.
Items are visible if CanvasComponent.zoom is below this threshold. Must be zero or positive and higher than lowerThreshold. Set to Number.POSITIVE_INFINITY to make items always visible above lowerThreshold.
readonlyfinal

Methods

Restarts the behavior after it has been stopped.
If the zoom level is currently outside the visible zoom interval, it fades the items out gradually. The behavior is initially active.
final

Return Value

Promise<boolean>
A promise that will resolve when the initial transition has finished. Will resolve immediately if no transition is necessary. The promise will resolve to true if the transition successfully finished and false if the transition was interrupted by stop.
Stops the behavior.
If the zoom level is currently outside the visible zoom interval, it fades the items in gradually. When invoked before this instance has been assigned to an item, there will be no transition. This allows to assign this behavior to items in an inactive state before turning it on later.
final

Return Value

Promise<boolean>
A promise that will resolve when the initial transition has finished. Will resolve immediately if no transition is necessary. The promise will resolve to true if the transition successfully finished and false if the transition was interrupted by start.