StyleByZoom

open class StyleByZoom<T>(valueByZoom: Map<Double, T>, defaultValue: T, interpolationFunction: (zoom: Double, minZoom: Double, maxZoom: Double, minZoomValue: T, maxZoomValue: T) -> T)

Represents the style value to use for each zoom level.

Important: This is a Public Preview API. It may be changed or removed at any time.

Parameters

valueByZoom

A mapping of zoom levels to a generic style type.

defaultValue

The default value used when no mapping is found.

interpolationFunction

Function used to interpolate style value between zoom levels.

Inheritors

Constructors

Link copied to clipboard
constructor(valueByZoom: Map<Double, T>, defaultValue: T, interpolationFunction: (zoom: Double, minZoom: Double, maxZoom: Double, minZoomValue: T, maxZoomValue: T) -> T)

Functions

Link copied to clipboard
operator fun get(key: Double): T

Returns the corresponding style value. If a zoom level does not exists, the value will interpolated using the interpolationFunction and the corresponding range. If valueByZoom is empty, defaultValue will be returned.