@mapbox/react-native-mapbox-gl
Version:
A Mapbox GL react native module for creating custom maps
1,591 lines (1,399 loc) • 41.4 kB
JavaScript
/* eslint-disable */
// DO NOT MODIFY
// THIS FILE IS AUTOGENERATED
import PropTypes from 'prop-types';
export const StyleTypes = {
Constant: 'constant',
Color: 'color',
Transition: 'transition',
Translation: 'translation',
Function: 'function',
Image: 'image',
};
export const StyleFunctionTypes = {
Camera: 'camera',
Source: 'source',
Composite: 'composite',
};
export const ConstantPropType = PropTypes.shape({
styletype: PropTypes.string.isRequired,
payload: PropTypes.shape({
value: PropTypes.any.isRequired,
}).isRequired,
});
export const StyleFunctionPropType = PropTypes.shape({
styletype: PropTypes.string.isRequired,
payload: PropTypes.shape({
fn: PropTypes.string,
attributeName: PropTypes.string,
stops: PropTypes.array,
mode: PropTypes.any,
}).isRequired,
});
export const TransitionPropType = PropTypes.shape({
duration: PropTypes.number,
delay: PropTypes.number,
});
export const TranslationPropType = PropTypes.oneOfType([
PropTypes.shape({
x: PropTypes.number.isRequired,
y: PropTypes.number.isRequired,
}),
PropTypes.arrayOf(PropTypes.number),
]);
export const FillLayerStyleProp = PropTypes.shape({
/**
* Whether this layer is displayed.
*/
visibility: PropTypes.any,
/**
* Whether or not the fill should be antialiased.
*/
fillAntialias: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The opacity of the entire fill layer. In contrast to the `fillColor`, this value will also affect the 1px stroke around the fill, if the stroke is used.
*/
fillOpacity: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s fillOpacity property.
*/
fillOpacityTransition: TransitionPropType,
/**
* The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.
*
* @disabledBy fillPattern
*/
fillColor: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s fillColor property.
*/
fillColorTransition: TransitionPropType,
/**
* The outline color of the fill. Matches the value of `fillColor` if unspecified.
*
* @disabledBy fillPattern
*/
fillOutlineColor: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s fillOutlineColor property.
*/
fillOutlineColorTransition: TransitionPropType,
/**
* The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
*/
fillTranslate: PropTypes.oneOfType([
TranslationPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s fillTranslate property.
*/
fillTranslateTransition: TransitionPropType,
/**
* Controls the frame of reference for `fillTranslate`.
*
* @requires fillTranslate
*/
fillTranslateAnchor: PropTypes.oneOfType([
TranslationPropType,
StyleFunctionPropType,
]),
/**
* Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).
*/
fillPattern: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s fillPattern property.
*/
fillPatternTransition: TransitionPropType,
});
export const LineLayerStyleProp = PropTypes.shape({
/**
* The display of line endings.
*/
lineCap: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* The display of lines when joining.
*/
lineJoin: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* Used to automatically convert miter joins to bevel joins for sharp angles.
*/
lineMiterLimit: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Used to automatically convert round joins to miter joins for shallow angles.
*/
lineRoundLimit: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Whether this layer is displayed.
*/
visibility: PropTypes.any,
/**
* The opacity at which the line will be drawn.
*/
lineOpacity: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s lineOpacity property.
*/
lineOpacityTransition: TransitionPropType,
/**
* The color with which the line will be drawn.
*
* @disabledBy linePattern
*/
lineColor: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s lineColor property.
*/
lineColorTransition: TransitionPropType,
/**
* The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
*/
lineTranslate: PropTypes.oneOfType([
TranslationPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s lineTranslate property.
*/
lineTranslateTransition: TransitionPropType,
/**
* Controls the frame of reference for `lineTranslate`.
*
* @requires lineTranslate
*/
lineTranslateAnchor: PropTypes.oneOfType([
TranslationPropType,
StyleFunctionPropType,
]),
/**
* Stroke thickness.
*/
lineWidth: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s lineWidth property.
*/
lineWidthTransition: TransitionPropType,
/**
* Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
*/
lineGapWidth: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s lineGapWidth property.
*/
lineGapWidthTransition: TransitionPropType,
/**
* The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.
*/
lineOffset: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s lineOffset property.
*/
lineOffsetTransition: TransitionPropType,
/**
* Blur applied to the line, in pixels.
*/
lineBlur: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s lineBlur property.
*/
lineBlurTransition: TransitionPropType,
/**
* Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width.
*
* @disabledBy linePattern
*/
lineDasharray: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.number),
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s lineDasharray property.
*/
lineDasharrayTransition: TransitionPropType,
/**
* Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512).
*/
linePattern: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s linePattern property.
*/
linePatternTransition: TransitionPropType,
});
export const SymbolLayerStyleProp = PropTypes.shape({
/**
* Label placement relative to its geometry.
*/
symbolPlacement: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* Distance between two symbol anchors.
*/
symbolSpacing: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.
*/
symbolAvoidEdges: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* If true, the icon will be visible even if it collides with other previously drawn symbols.
*
* @requires iconImage
*/
iconAllowOverlap: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* If true, other symbols can be visible even if they collide with the icon.
*
* @requires iconImage
*/
iconIgnorePlacement: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
*
* @requires iconImage, textField
*/
iconOptional: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* In combination with `symbolPlacement`, determines the rotation behavior of icons.
*
* @requires iconImage
*/
iconRotationAlignment: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `iconSize`. 1 is the original size; 3 triples the size of the image.
*
* @requires iconImage
*/
iconSize: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Scales the icon to fit around the associated text.
*
* @requires iconImage, textField
*/
iconTextFit: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* Size of the additional area added to dimensions determined by `iconTextFit`, in clockwise order: top, right, bottom, left.
*
* @requires iconImage, textField
*/
iconTextFitPadding: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.number),
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Name of image in sprite to use for drawing an image background. A string with `{tokens}` replaced, referencing the data property to pull from. (`{token}` replacement is only supported for literal `iconImage` values; not for property functions.)
*/
iconImage: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Rotates the icon clockwise.
*
* @requires iconImage
*/
iconRotate: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Size of the additional area around the icon bounding box used for detecting symbol collisions.
*
* @requires iconImage
*/
iconPadding: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* If true, the icon may be flipped to prevent it from being rendered upsideDown.
*
* @requires iconImage
*/
iconKeepUpright: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. When combined with `iconRotate` the offset will be as if the rotated direction was up.
*
* @requires iconImage
*/
iconOffset: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.number),
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Part of the icon placed closest to the anchor.
*
* @requires iconImage
*/
iconAnchor: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* Orientation of icon when map is pitched.
*
* @requires iconImage
*/
iconPitchAlignment: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* Orientation of text when map is pitched.
*
* @requires textField
*/
textPitchAlignment: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text.
*
* @requires textField
*/
textRotationAlignment: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* Value to use for a text label. Feature properties are specified using tokens like `{field_name}`. (`{token}` replacement is only supported for literal `textField` values; not for property functions.)
*/
textField: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Font stack to use for displaying text.
*
* @requires textField
*/
textFont: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.string),
PropTypes.array,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Font size.
*
* @requires textField
*/
textSize: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The maximum line width for text wrapping.
*
* @requires textField
*/
textMaxWidth: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Text leading value for multiLine text.
*
* @requires textField
*/
textLineHeight: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Text tracking amount.
*
* @requires textField
*/
textLetterSpacing: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Text justification options.
*
* @requires textField
*/
textJustify: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* Part of the text placed closest to the anchor.
*
* @requires textField
*/
textAnchor: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* Maximum angle change between adjacent characters.
*
* @requires textField
*/
textMaxAngle: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Rotates the text clockwise.
*
* @requires textField
*/
textRotate: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Size of the additional area around the text bounding box used for detecting symbol collisions.
*
* @requires textField
*/
textPadding: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* If true, the text may be flipped vertically to prevent it from being rendered upsideDown.
*
* @requires textField
*/
textKeepUpright: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Specifies how to capitalize text, similar to the CSS `textTransform` property.
*
* @requires textField
*/
textTransform: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.
*
* @requires textField
*/
textOffset: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.number),
ConstantPropType,
StyleFunctionPropType,
]),
/**
* If true, the text will be visible even if it collides with other previously drawn symbols.
*
* @requires textField
*/
textAllowOverlap: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* If true, other symbols can be visible even if they collide with the text.
*
* @requires textField
*/
textIgnorePlacement: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
*
* @requires textField, iconImage
*/
textOptional: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* Whether this layer is displayed.
*/
visibility: PropTypes.any,
/**
* The opacity at which the icon will be drawn.
*
* @requires iconImage
*/
iconOpacity: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s iconOpacity property.
*/
iconOpacityTransition: TransitionPropType,
/**
* The color of the icon. This can only be used with sdf icons.
*
* @requires iconImage
*/
iconColor: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s iconColor property.
*/
iconColorTransition: TransitionPropType,
/**
* The color of the icon's halo. Icon halos can only be used with SDF icons.
*
* @requires iconImage
*/
iconHaloColor: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s iconHaloColor property.
*/
iconHaloColorTransition: TransitionPropType,
/**
* Distance of halo to the icon outline.
*
* @requires iconImage
*/
iconHaloWidth: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s iconHaloWidth property.
*/
iconHaloWidthTransition: TransitionPropType,
/**
* Fade out the halo towards the outside.
*
* @requires iconImage
*/
iconHaloBlur: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s iconHaloBlur property.
*/
iconHaloBlurTransition: TransitionPropType,
/**
* Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
*
* @requires iconImage
*/
iconTranslate: PropTypes.oneOfType([
TranslationPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s iconTranslate property.
*/
iconTranslateTransition: TransitionPropType,
/**
* Controls the frame of reference for `iconTranslate`.
*
* @requires iconImage, iconTranslate
*/
iconTranslateAnchor: PropTypes.oneOfType([
TranslationPropType,
StyleFunctionPropType,
]),
/**
* The opacity at which the text will be drawn.
*
* @requires textField
*/
textOpacity: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s textOpacity property.
*/
textOpacityTransition: TransitionPropType,
/**
* The color with which the text will be drawn.
*
* @requires textField
*/
textColor: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s textColor property.
*/
textColorTransition: TransitionPropType,
/**
* The color of the text's halo, which helps it stand out from backgrounds.
*
* @requires textField
*/
textHaloColor: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s textHaloColor property.
*/
textHaloColorTransition: TransitionPropType,
/**
* Distance of halo to the font outline. Max text halo width is 1/4 of the fontSize.
*
* @requires textField
*/
textHaloWidth: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s textHaloWidth property.
*/
textHaloWidthTransition: TransitionPropType,
/**
* The halo's fadeout distance towards the outside.
*
* @requires textField
*/
textHaloBlur: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s textHaloBlur property.
*/
textHaloBlurTransition: TransitionPropType,
/**
* Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
*
* @requires textField
*/
textTranslate: PropTypes.oneOfType([
TranslationPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s textTranslate property.
*/
textTranslateTransition: TransitionPropType,
/**
* Controls the frame of reference for `textTranslate`.
*
* @requires textField, textTranslate
*/
textTranslateAnchor: PropTypes.oneOfType([
TranslationPropType,
StyleFunctionPropType,
]),
});
export const CircleLayerStyleProp = PropTypes.shape({
/**
* Whether this layer is displayed.
*/
visibility: PropTypes.any,
/**
* Circle radius.
*/
circleRadius: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s circleRadius property.
*/
circleRadiusTransition: TransitionPropType,
/**
* The fill color of the circle.
*/
circleColor: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s circleColor property.
*/
circleColorTransition: TransitionPropType,
/**
* Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
*/
circleBlur: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s circleBlur property.
*/
circleBlurTransition: TransitionPropType,
/**
* The opacity at which the circle will be drawn.
*/
circleOpacity: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s circleOpacity property.
*/
circleOpacityTransition: TransitionPropType,
/**
* The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
*/
circleTranslate: PropTypes.oneOfType([
TranslationPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s circleTranslate property.
*/
circleTranslateTransition: TransitionPropType,
/**
* Controls the frame of reference for `circleTranslate`.
*
* @requires circleTranslate
*/
circleTranslateAnchor: PropTypes.oneOfType([
TranslationPropType,
StyleFunctionPropType,
]),
/**
* Controls the scaling behavior of the circle when the map is pitched.
*/
circlePitchScale: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* Orientation of circle when map is pitched.
*/
circlePitchAlignment: PropTypes.oneOfType([
PropTypes.any,
StyleFunctionPropType,
]),
/**
* The width of the circle's stroke. Strokes are placed outside of the `circleRadius`.
*/
circleStrokeWidth: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s circleStrokeWidth property.
*/
circleStrokeWidthTransition: TransitionPropType,
/**
* The stroke color of the circle.
*/
circleStrokeColor: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s circleStrokeColor property.
*/
circleStrokeColorTransition: TransitionPropType,
/**
* The opacity of the circle's stroke.
*/
circleStrokeOpacity: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s circleStrokeOpacity property.
*/
circleStrokeOpacityTransition: TransitionPropType,
});
export const FillExtrusionLayerStyleProp = PropTypes.shape({
/**
* Whether this layer is displayed.
*/
visibility: PropTypes.any,
/**
* The opacity of the entire fill extrusion layer. This is rendered on a perLayer, not perFeature, basis, and dataDriven styling is not available.
*/
fillExtrusionOpacity: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s fillExtrusionOpacity property.
*/
fillExtrusionOpacityTransition: TransitionPropType,
/**
* The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fillExtrusionOpacity` to set layer opacity.
*
* @disabledBy fillExtrusionPattern
*/
fillExtrusionColor: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s fillExtrusionColor property.
*/
fillExtrusionColorTransition: TransitionPropType,
/**
* The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.
*/
fillExtrusionTranslate: PropTypes.oneOfType([
TranslationPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s fillExtrusionTranslate property.
*/
fillExtrusionTranslateTransition: TransitionPropType,
/**
* Controls the frame of reference for `fillExtrusionTranslate`.
*
* @requires fillExtrusionTranslate
*/
fillExtrusionTranslateAnchor: PropTypes.oneOfType([
TranslationPropType,
StyleFunctionPropType,
]),
/**
* Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).
*/
fillExtrusionPattern: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s fillExtrusionPattern property.
*/
fillExtrusionPatternTransition: TransitionPropType,
/**
* The height with which to extrude this layer.
*/
fillExtrusionHeight: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s fillExtrusionHeight property.
*/
fillExtrusionHeightTransition: TransitionPropType,
/**
* The height with which to extrude the base of this layer. Must be less than or equal to `fillExtrusionHeight`.
*
* @requires fillExtrusionHeight
*/
fillExtrusionBase: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s fillExtrusionBase property.
*/
fillExtrusionBaseTransition: TransitionPropType,
});
export const RasterLayerStyleProp = PropTypes.shape({
/**
* Whether this layer is displayed.
*/
visibility: PropTypes.any,
/**
* The opacity at which the image will be drawn.
*/
rasterOpacity: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s rasterOpacity property.
*/
rasterOpacityTransition: TransitionPropType,
/**
* Rotates hues around the color wheel.
*/
rasterHueRotate: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s rasterHueRotate property.
*/
rasterHueRotateTransition: TransitionPropType,
/**
* Increase or reduce the brightness of the image. The value is the minimum brightness.
*/
rasterBrightnessMin: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s rasterBrightnessMin property.
*/
rasterBrightnessMinTransition: TransitionPropType,
/**
* Increase or reduce the brightness of the image. The value is the maximum brightness.
*/
rasterBrightnessMax: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s rasterBrightnessMax property.
*/
rasterBrightnessMaxTransition: TransitionPropType,
/**
* Increase or reduce the saturation of the image.
*/
rasterSaturation: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s rasterSaturation property.
*/
rasterSaturationTransition: TransitionPropType,
/**
* Increase or reduce the contrast of the image.
*/
rasterContrast: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s rasterContrast property.
*/
rasterContrastTransition: TransitionPropType,
/**
* Fade duration when a new tile is added.
*/
rasterFadeDuration: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s rasterFadeDuration property.
*/
rasterFadeDurationTransition: TransitionPropType,
});
export const BackgroundLayerStyleProp = PropTypes.shape({
/**
* Whether this layer is displayed.
*/
visibility: PropTypes.any,
/**
* The color with which the background will be drawn.
*
* @disabledBy backgroundPattern
*/
backgroundColor: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s backgroundColor property.
*/
backgroundColorTransition: TransitionPropType,
/**
* Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).
*/
backgroundPattern: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s backgroundPattern property.
*/
backgroundPatternTransition: TransitionPropType,
/**
* The opacity at which the background will be drawn.
*/
backgroundOpacity: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
StyleFunctionPropType,
]),
/**
* The transition affecting any changes to this layer’s backgroundOpacity property.
*/
backgroundOpacityTransition: TransitionPropType,
});
export const LightLayerStyleProp = PropTypes.shape({
/**
* Whether extruded geometries are lit relative to the map or viewport.
*/
anchor: PropTypes.any,
/**
* Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).
*/
position: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.number),
ConstantPropType,
]),
/**
* The transition affecting any changes to this layer’s position property.
*/
positionTransition: TransitionPropType,
/**
* Color tint for lighting extruded geometries.
*/
color: PropTypes.oneOfType([
PropTypes.string,
ConstantPropType,
]),
/**
* The transition affecting any changes to this layer’s color property.
*/
colorTransition: TransitionPropType,
/**
* Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.
*/
intensity: PropTypes.oneOfType([
PropTypes.number,
ConstantPropType,
]),
/**
* The transition affecting any changes to this layer’s intensity property.
*/
intensityTransition: TransitionPropType,
});
const styleMap = {
fillAntialias: StyleTypes.Constant,
fillOpacity: StyleTypes.Constant,
fillOpacityTransition: StyleTypes.Transition,
fillColor: StyleTypes.Color,
fillColorTransition: StyleTypes.Transition,
fillOutlineColor: StyleTypes.Color,
fillOutlineColorTransition: StyleTypes.Transition,
fillTranslate: StyleTypes.Translation,
fillTranslateTransition: StyleTypes.Transition,
fillTranslateAnchor: StyleTypes.Translation,
fillPattern: StyleTypes.Image,
fillPatternTransition: StyleTypes.Transition,
lineCap: StyleTypes.Constant,
lineJoin: StyleTypes.Constant,
lineMiterLimit: StyleTypes.Constant,
lineRoundLimit: StyleTypes.Constant,
lineOpacity: StyleTypes.Constant,
lineOpacityTransition: StyleTypes.Transition,
lineColor: StyleTypes.Color,
lineColorTransition: StyleTypes.Transition,
lineTranslate: StyleTypes.Translation,
lineTranslateTransition: StyleTypes.Transition,
lineTranslateAnchor: StyleTypes.Translation,
lineWidth: StyleTypes.Constant,
lineWidthTransition: StyleTypes.Transition,
lineGapWidth: StyleTypes.Constant,
lineGapWidthTransition: StyleTypes.Transition,
lineOffset: StyleTypes.Constant,
lineOffsetTransition: StyleTypes.Transition,
lineBlur: StyleTypes.Constant,
lineBlurTransition: StyleTypes.Transition,
lineDasharray: StyleTypes.Constant,
lineDasharrayTransition: StyleTypes.Transition,
linePattern: StyleTypes.Image,
linePatternTransition: StyleTypes.Transition,
symbolPlacement: StyleTypes.Constant,
symbolSpacing: StyleTypes.Constant,
symbolAvoidEdges: StyleTypes.Constant,
iconAllowOverlap: StyleTypes.Constant,
iconIgnorePlacement: StyleTypes.Constant,
iconOptional: StyleTypes.Constant,
iconRotationAlignment: StyleTypes.Constant,
iconSize: StyleTypes.Constant,
iconTextFit: StyleTypes.Constant,
iconTextFitPadding: StyleTypes.Constant,
iconImage: StyleTypes.Image,
iconRotate: StyleTypes.Constant,
iconPadding: StyleTypes.Constant,
iconKeepUpright: StyleTypes.Constant,
iconOffset: StyleTypes.Constant,
iconAnchor: StyleTypes.Constant,
iconPitchAlignment: StyleTypes.Constant,
textPitchAlignment: StyleTypes.Constant,
textRotationAlignment: StyleTypes.Constant,
textField: StyleTypes.Constant,
textFont: StyleTypes.Constant,
textSize: StyleTypes.Constant,
textMaxWidth: StyleTypes.Constant,
textLineHeight: StyleTypes.Constant,
textLetterSpacing: StyleTypes.Constant,
textJustify: StyleTypes.Constant,
textAnchor: StyleTypes.Constant,
textMaxAngle: StyleTypes.Constant,
textRotate: StyleTypes.Constant,
textPadding: StyleTypes.Constant,
textKeepUpright: StyleTypes.Constant,
textTransform: StyleTypes.Constant,
textOffset: StyleTypes.Constant,
textAllowOverlap: StyleTypes.Constant,
textIgnorePlacement: StyleTypes.Constant,
textOptional: StyleTypes.Constant,
iconOpacity: StyleTypes.Constant,
iconOpacityTransition: StyleTypes.Transition,
iconColor: StyleTypes.Color,
iconColorTransition: StyleTypes.Transition,
iconHaloColor: StyleTypes.Color,
iconHaloColorTransition: StyleTypes.Transition,
iconHaloWidth: StyleTypes.Constant,
iconHaloWidthTransition: StyleTypes.Transition,
iconHaloBlur: StyleTypes.Constant,
iconHaloBlurTransition: StyleTypes.Transition,
iconTranslate: StyleTypes.Translation,
iconTranslateTransition: StyleTypes.Transition,
iconTranslateAnchor: StyleTypes.Translation,
textOpacity: StyleTypes.Constant,
textOpacityTransition: StyleTypes.Transition,
textColor: StyleTypes.Color,
textColorTransition: StyleTypes.Transition,
textHaloColor: StyleTypes.Color,
textHaloColorTransition: StyleTypes.Transition,
textHaloWidth: StyleTypes.Constant,
textHaloWidthTransition: StyleTypes.Transition,
textHaloBlur: StyleTypes.Constant,
textHaloBlurTransition: StyleTypes.Transition,
textTranslate: StyleTypes.Translation,
textTranslateTransition: StyleTypes.Transition,
textTranslateAnchor: StyleTypes.Translation,
circleRadius: StyleTypes.Constant,
circleRadiusTransition: StyleTypes.Transition,
circleColor: StyleTypes.Color,
circleColorTransition: StyleTypes.Transition,
circleBlur: StyleTypes.Constant,
circleBlurTransition: StyleTypes.Transition,
circleOpacity: StyleTypes.Constant,
circleOpacityTransition: StyleTypes.Transition,
circleTranslate: StyleTypes.Translation,
circleTranslateTransition: StyleTypes.Transition,
circleTranslateAnchor: StyleTypes.Translation,
circlePitchScale: StyleTypes.Constant,
circlePitchAlignment: StyleTypes.Constant,
circleStrokeWidth: StyleTypes.Constant,
circleStrokeWidthTransition: StyleTypes.Transition,
circleStrokeColor: StyleTypes.Color,
circleStrokeColorTransition: StyleTypes.Transition,
circleStrokeOpacity: StyleTypes.Constant,
circleStrokeOpacityTransition: StyleTypes.Transition,
fillExtrusionOpacity: StyleTypes.Constant,
fillExtrusionOpacityTransition: StyleTypes.Transition,
fillExtrusionColor: StyleTypes.Color,
fillExtrusionColorTransition: StyleTypes.Transition,
fillExtrusionTranslate: StyleTypes.Translation,
fillExtrusionTranslateTransition: StyleTypes.Transition,
fillExtrusionTranslateAnchor: StyleTypes.Translation,
fillExtrusionPattern: StyleTypes.Image,
fillExtrusionPatternTransition: StyleTypes.Transition,
fillExtrusionHeight: StyleTypes.Constant,
fillExtrusionHeightTransition: StyleTypes.Transition,
fillExtrusionBase: StyleTypes.Constant,
fillExtrusionBaseTransition: StyleTypes.Transition,
rasterOpacity: StyleTypes.Constant,
rasterOpacityTransition: StyleTypes.Transition,
rasterHueRotate: StyleTypes.Constant,
rasterHueRotateTransition: StyleTypes.Transition,
rasterBrightnessMin: StyleTypes.Constant,
rasterBrightnessMinTransition: StyleTypes.Transition,
rasterBrightnessMax: StyleTypes.Constant,
rasterBrightnessMaxTransition: StyleTypes.Transition,
rasterSaturation: StyleTypes.Constant,
rasterSaturationTransition: StyleTypes.Transition,
rasterContrast: StyleTypes.Constant,
rasterContrastTransition: StyleTypes.Transition,
rasterFadeDuration: StyleTypes.Constant,
rasterFadeDurationTransition: StyleTypes.Transition,
backgroundColor: StyleTypes.Color,
backgroundColorTransition: StyleTypes.Transition,
backgroundPattern: StyleTypes.Image,
backgroundPatternTransition: StyleTypes.Transition,
backgroundOpacity: StyleTypes.Constant,
backgroundOpacityTransition: StyleTypes.Transition,
anchor: StyleTypes.Constant,
position: StyleTypes.Constant,
positionTransition: StyleTypes.Transition,
color: StyleTypes.Color,
colorTransition: StyleTypes.Transition,
intensity: StyleTypes.Constant,
intensityTransition: StyleTypes.Transition,
visibility: StyleTypes.Constant,
};
export const styleExtras = {
// offsets
iconOffset: {
iosType: 'vector',
},
textOffset: {
iosType: 'vector',
},
lineOffset: {
iosType: 'vector',
},
// translates
fillTranslate: {
iosType: 'vector',
},
lineTranslate: {
iosType: 'vector',
},
iconTranslate: {
iosType: 'vector',
},
textTranslate: {
iosType: 'vector',
},
circleTranslate: {
iosType: 'vector',
},
fillExtrusionTranslate: {
iosType: 'vector',
},
};
export default styleMap;