Intesity or TileLayer layer
The TileLayer consists of multiple timeframes, every frame is a tile pyramid in a different moment in time. The individual frames are smoothly animated. Decoding of the data and their visual representation is configurable.
Example
Constructor
Parameters
options.minZoom
default: 0
|
Minimum zoom of the tile pyramids that will be added into this layer. |
---|---|
options.maxZoom
default: 4
|
Maximum zoom of the tile pyramids that will be added into this layer. |
options.bounds | Limited bounds ([west, south, east, north] in degrees) of the tile pyramids - tiles outside this will not be loaded. |
options.renderTransparentArea
default: false
|
Rendering areas with opacity < 1.0. |
options.repaintOnPausedAnimation
default: true
|
Indicated whether the the function map.triggerRepaint() should be called when the animation is paused. |
options.timeInterpolation
default: true
|
Linear interpolation between keyframes when true, or jumping from a keyframe to the next when ⚠️Note:this will only have an effect if using a MultiChannelColoringFragment |
options.categorySmoothTransition
default: false
|
Bilinear interpolation of category color (but not of category value) when true (requires more performance).
No interpolation when false . Applies only to TileLayers using MultiChannelGradientColoringFragment (as the other types of Coloring Fragment are not compatible with categories) |
options.localSmoothing
default: false
|
Enables the local smoothing if true . |
options.nbSmoothingBins
default: 16
|
Number of adjacent texture reads used to compute a smooth average for each pixel on screen.
If 0 , then only the central point is read, which does the same as localSmoothing = false .
If very high (32 or more), will have a performance impact on low-end devices.
|
options.maxSmoothingDistance
default: 10
|
The distance of the smoothing bins are dependant of the zoom-level. The distance is the longest at z0 and decays. maxSmoothingDistance is the distance at z0. |
options.smoothingDistanceDecayFactor
default: 12
|
The decay factor has an influence on how the distance between the reference texture and its adjacent bins diminishes as the zoom level gets higher.
If smoothingDistanceDecayFactor is closer to 0 , the decaying function will have the shape of the inverse function (fast decay very quickly).
f smoothingDistanceDecayFactor is closer to 100 , the decay is considered linear
|
options.loadLowerZoomLevels
default: true
|
If true , will load the lower zoom level (up to z0) if the tile of requested zoom level is not ready/loaded.
This will lead to visually smoother transitions as zooming in but will require fetching more tiles at high zoom level.
If false , will load only the tile of the requested zoom level.
|
options.interpolateTileEdge
default: false
|
If true , the edges of each tile is will be interpolated with its neighbor tile to abtain smoother in-between-tile transition.
This requires sending more tiles (textures) to the GPU and perform more texture reads, which could impact performance.
Note: at the moment, this is only implemented for MultiChannelGradientColoringFragment
|
Methods
Check out the Layers method reference
This function is called in the constructor if it receives the options.
This function is useful for initializing a layer with data that comes from an asynchronous function.
For example: used in the onAdd
function of the temperature layer after fetching the data from the MapTiler cloud.
ColoringFragmentBase[]
)
: Use function to generate coloring from the pixel values. Same as the layer constructor
MultiChannelGradientColoringFragment
)
: Use function to generate coloring from image channels in the context of a multi channel gradient coloring fragment. Same as the layer constructor
Adds another frame to the animation.
string
)
: URL to the tiles. Expected to have `{zxy}` placeholder to be dynamically replaced with `z/x/y` coordinates.
Picks the best currently available values at the position. The values are read from the already loaded tiles at the current time.
Return the interpolated array of decoded values of the same length as the number of specified coloring fragments.
If the coloring fragments uses more channels (e.g. "rg"),
the corresponding value is an array of [r value, g value, sqrt(r^2 + g^2)]
.
Array
: Array of decoded interpolated values.
Enables data linear interpolation between keyframes when true
.
Only shows keyframe data when false
.
⚠️Note:this will only have an effect if using a MultiChannelColoringFragment
Enable smoothing category color when true
. Hard edge between categories when false
.
This seeting applies only to TileLayers using MultiChannelGradientColoringFragment as the other types of coloring fragment do not use categories.
Defines by what factor the smoothing kernel size is reduced with increasing zoom level.
If true
, even the paused animation is rendered up to 60 times per seconds.
If false
, the rendering is paused when the animation is paused.
Pausing the animation has side effects:
- it lowers energy consumtion
- it prevents overheating
- it pauses time-independant annimation (arrows, particles)