Skip to content

Latest commit

 

History

History
362 lines (215 loc) · 7.13 KB

SkyLayer.md

File metadata and controls

362 lines (215 loc) · 7.13 KB

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

props

id

string

required A string that uniquely identifies the source in the style to which it is added.

existing

boolean

The id refers to en existing layer in the style. Does not create a new layer.

sourceID

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

aboveLayerID

string

Inserts a layer above aboveLayerID.

belowLayerID

string

Inserts a layer below belowLayerID

layerIndex

number

Inserts a layer at a specified index

filter

FilterExpression

Filter only the features in the source layer that satisfy a condition that you define

style

SkyLayerStyleProps

Customizable style attributes

styles


visibility

Name: visibility

Mapbox spec: visibility

Description

Whether this layer is displayed.

Type

enum

Default Value

visible

Supported Values

visible - The layer is shown.
none - The layer is not shown.

Expression

Parameters: ``


skyType

Name: skyType

Mapbox spec: sky-type

Description

The type of the sky

Type

enum

Default Value

atmosphere

Supported Values

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.

Expression

Parameters: zoom


skyAtmosphereSun

Name: skyAtmosphereSun

Mapbox spec: sky-atmosphere-sun

Description

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.

Type

array<number>

Units

degrees

Minimum

0,0

Maximum

360,180

Expression

Parameters: zoom


skyAtmosphereSunIntensity

Name: skyAtmosphereSunIntensity

Mapbox spec: sky-atmosphere-sun-intensity

Description

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.

Type

number

Default Value

10

Minimum

0

Maximum

100


skyGradientCenter

Name: skyGradientCenter

Mapbox spec: sky-gradient-center

Description

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.

Type

array<number>

Default Value

[0,0]

Units

degrees

Minimum

0,0

Maximum

360,180

Expression

Parameters: zoom


skyGradientRadius

Name: skyGradientRadius

Mapbox spec: sky-gradient-radius

Description

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.

Type

number

Default Value

90

Minimum

0

Maximum

180

Expression

Parameters: zoom


skyGradient

Name: skyGradient

Mapbox spec: sky-gradient

Description

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.

Type

color

Default Value

interpolate,linear,sky-radial-progress,0.8,#87ceeb,1,white

Expression

Parameters: sky-radial-progress


skyAtmosphereHaloColor

Name: skyAtmosphereHaloColor

Mapbox spec: sky-atmosphere-halo-color

Description

A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.

Type

color

Default Value

white


skyAtmosphereColor

Name: skyAtmosphereColor

Mapbox spec: sky-atmosphere-color

Description

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.

Type

color

Default Value

white


skyOpacity

Name: skyOpacity

Mapbox spec: sky-opacity

Description

The opacity of the entire sky layer.

Type

number

Default Value

1

Minimum

0

Maximum

1

Expression

Parameters: zoom


skyOpacityTransition

Name: skyOpacityTransition

Description

The transition affecting any changes to this layer’s skyOpacity property.

Type

{ duration, delay }

Units

milliseconds

Default Value

{duration: 300, delay: 0}