Mapbox spec: sky
import { SkyLayer } from '@rnmapbox/maps';
SkyLayer
SkyLayer is a spherical dome around the map that is always rendered behind all other layers
string
required A string that uniquely identifies the source in the style to which it is added.
boolean
The id refers to en existing layer in the style. Does not create a new layer.
string
The source from which to obtain the data to style. If the source has not yet been added to the current style, the behavior is undefined.
defaults to: Mapbox.StyleSource.DefaultSourceID
string
Inserts a layer above aboveLayerID.
string
Inserts a layer below belowLayerID
number
Inserts a layer at a specified index
FilterExpression
Filter only the features in the source layer that satisfy a condition that you define
SkyLayerStyleProps
Customizable style attributes
- visibility
- skyType
- skyAtmosphereSun
- skyAtmosphereSunIntensity
- skyGradientCenter
- skyGradientRadius
- skyGradient
- skyAtmosphereHaloColor
- skyAtmosphereColor
- skyOpacity
Name: visibility
Mapbox spec: visibility
Whether this layer is displayed.
enum
visible
visible - The layer is shown.
none - The layer is not shown.
Parameters: ``
Name: skyType
Mapbox spec: sky-type
The type of the sky
enum
atmosphere
gradient - Renders the sky with a gradient that can be configured with sky-gradient-radius
and sky-gradient
.
atmosphere - Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through sky-atmosphere-sun
.
Parameters: zoom
Name: skyAtmosphereSun
Mapbox spec: sky-atmosphere-sun
Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.
array<number>
degrees
0,0
360,180
Parameters: zoom
Name: skyAtmosphereSunIntensity
Mapbox spec: sky-atmosphere-sun-intensity
Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.
number
10
0
100
Name: skyGradientCenter
Mapbox spec: sky-gradient-center
Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.
array<number>
[0,0]
degrees
0,0
360,180
Parameters: zoom
Name: skyGradientRadius
Mapbox spec: sky-gradient-radius
The angular distance (measured in degrees) from skyGradientCenter
up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from skyGradientCenter
.
number
90
0
180
Parameters: zoom
Name: skyGradient
Mapbox spec: sky-gradient
Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using skyRadialProgress
. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, skyGradientRadius
] centered at the position specified by skyGradientCenter
.
color
interpolate,linear,sky-radial-progress,0.8,#87ceeb,1,white
Parameters: sky-radial-progress
Name: skyAtmosphereHaloColor
Mapbox spec: sky-atmosphere-halo-color
A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.
color
white
Name: skyAtmosphereColor
Mapbox spec: sky-atmosphere-color
A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.
color
white
Name: skyOpacity
Mapbox spec: sky-opacity
The opacity of the entire sky layer.
number
1
0
1
Parameters: zoom
Name: skyOpacityTransition
The transition affecting any changes to this layer’s skyOpacity property.
{ duration, delay }
milliseconds
{duration: 300, delay: 0}