UNPKG

@react-native-mapbox-gl/maps

Version:

A Mapbox GL react native module for creating custom maps

1,842 lines (1,629 loc) 51.4 kB
/* eslint-disable */ // DO NOT MODIFY // THIS FILE IS AUTOGENERATED import PropTypes from 'prop-types'; import { IS_ANDROID } from './index'; export const StyleTypes = { Constant: 'constant', Color: 'color', Transition: 'transition', Translation: 'translation', Function: 'function', Image: 'image', Enum: 'enum', }; export function getStyleType(styleProp) { if (!IS_ANDROID && styleExtras[styleProp]) { return styleExtras[styleProp].iosType; } if (styleMap[styleProp]) { return styleMap[styleProp]; } throw new Error(`${styleProp} is not a valid Mapbox layer style`); } export const FillLayerStyleProp = PropTypes.shape({ /** * Whether this layer is displayed. */ visibility: PropTypes.oneOf(['visible', 'none']), /** * Whether or not the fill should be antialiased. */ fillAntialias: PropTypes.oneOfType([ PropTypes.bool, PropTypes.array, ]), /** * 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, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s fillOpacity property. */ fillOpacityTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * 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, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s fillColor property. */ fillColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The outline color of the fill. Matches the value of `fillColor` if unspecified. * * @disabledBy fillPattern */ fillOutlineColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s fillOutlineColor property. */ fillOutlineColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. */ fillTranslate: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.number), PropTypes.array, ]), /** * The transition affecting any changes to this layer’s fillTranslate property. */ fillTranslateTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Controls the frame of reference for `fillTranslate`. * * @requires fillTranslate */ fillTranslateAnchor: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport']), PropTypes.array, ]), /** * 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). Note that zoomDependent expressions will be evaluated only at integer zoom levels. */ fillPattern: PropTypes.oneOfType([ PropTypes.number, PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s fillPattern property. */ fillPatternTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), }); export const LineLayerStyleProp = PropTypes.shape({ /** * The display of line endings. */ lineCap: PropTypes.oneOfType([ PropTypes.oneOf(['butt', 'round', 'square']), PropTypes.array, ]), /** * The display of lines when joining. */ lineJoin: PropTypes.oneOfType([ PropTypes.oneOf(['bevel', 'round', 'miter']), PropTypes.array, ]), /** * Used to automatically convert miter joins to bevel joins for sharp angles. */ lineMiterLimit: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * Used to automatically convert round joins to miter joins for shallow angles. */ lineRoundLimit: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * Whether this layer is displayed. */ visibility: PropTypes.oneOf(['visible', 'none']), /** * The opacity at which the line will be drawn. */ lineOpacity: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s lineOpacity property. */ lineOpacityTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The color with which the line will be drawn. * * @disabledBy linePattern */ lineColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s lineColor property. */ lineColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. */ lineTranslate: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.number), PropTypes.array, ]), /** * The transition affecting any changes to this layer’s lineTranslate property. */ lineTranslateTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Controls the frame of reference for `lineTranslate`. * * @requires lineTranslate */ lineTranslateAnchor: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport']), PropTypes.array, ]), /** * Stroke thickness. */ lineWidth: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s lineWidth property. */ lineWidthTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap. */ lineGapWidth: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s lineGapWidth property. */ lineGapWidthTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * 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, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s lineOffset property. */ lineOffsetTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Blur applied to the line, in pixels. */ lineBlur: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s lineBlur property. */ lineBlurTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * 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. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoomDependent expressions will be evaluated only at integer zoom levels. * * @disabledBy linePattern */ lineDasharray: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.number), PropTypes.array, ]), /** * The transition affecting any changes to this layer’s lineDasharray property. */ lineDasharrayTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * 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). Note that zoomDependent expressions will be evaluated only at integer zoom levels. */ linePattern: PropTypes.oneOfType([ PropTypes.number, PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s linePattern property. */ linePatternTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`. * * @disabledBy lineDasharray, linePattern */ lineGradient: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), }); export const SymbolLayerStyleProp = PropTypes.shape({ /** * Label placement relative to its geometry. */ symbolPlacement: PropTypes.oneOfType([ PropTypes.oneOf(['point', 'line', 'line-center']), PropTypes.array, ]), /** * Distance between two symbol anchors. */ symbolSpacing: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * 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. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries. */ symbolAvoidEdges: PropTypes.oneOfType([ PropTypes.bool, PropTypes.array, ]), /** * Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key when they overlap. Features with a lower sort key will have priority over other features when doing placement. */ symbolSortKey: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * Controls the order in which overlapping symbols in the same layer are rendered */ symbolZOrder: PropTypes.oneOfType([ PropTypes.oneOf(['auto', 'viewport-y', 'source']), PropTypes.array, ]), /** * If true, the icon will be visible even if it collides with other previously drawn symbols. * * @requires iconImage */ iconAllowOverlap: PropTypes.oneOfType([ PropTypes.bool, PropTypes.array, ]), /** * If true, other symbols can be visible even if they collide with the icon. * * @requires iconImage */ iconIgnorePlacement: PropTypes.oneOfType([ PropTypes.bool, PropTypes.array, ]), /** * 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.bool, PropTypes.array, ]), /** * In combination with `symbolPlacement`, determines the rotation behavior of icons. * * @requires iconImage */ iconRotationAlignment: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport', 'auto']), PropTypes.array, ]), /** * 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, PropTypes.array, ]), /** * Scales the icon to fit around the associated text. * * @requires iconImage, textField */ iconTextFit: PropTypes.oneOfType([ PropTypes.oneOf(['none', 'width', 'height', 'both']), PropTypes.array, ]), /** * 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), PropTypes.array, ]), /** * Name of image in sprite to use for drawing an image background. */ iconImage: PropTypes.oneOfType([ PropTypes.number, PropTypes.string, PropTypes.array, ]), /** * Rotates the icon clockwise. * * @requires iconImage */ iconRotate: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * Size of the additional area around the icon bounding box used for detecting symbol collisions. * * @requires iconImage */ iconPadding: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * If true, the icon may be flipped to prevent it from being rendered upsideDown. * * @requires iconImage */ iconKeepUpright: PropTypes.oneOfType([ PropTypes.bool, PropTypes.array, ]), /** * Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `iconSize` to obtain the final offset in pixels. When combined with `iconRotate` the offset will be as if the rotated direction was up. * * @requires iconImage */ iconOffset: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.number), PropTypes.array, ]), /** * Part of the icon placed closest to the anchor. * * @requires iconImage */ iconAnchor: PropTypes.oneOfType([ PropTypes.oneOf(['center', 'left', 'right', 'top', 'bottom', 'top-left', 'top-right', 'bottom-left', 'bottom-right']), PropTypes.array, ]), /** * Orientation of icon when map is pitched. * * @requires iconImage */ iconPitchAlignment: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport', 'auto']), PropTypes.array, ]), /** * Orientation of text when map is pitched. * * @requires textField */ textPitchAlignment: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport', 'auto']), PropTypes.array, ]), /** * In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text. * * @requires textField */ textRotationAlignment: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport', 'auto']), PropTypes.array, ]), /** * Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. */ textField: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * Font stack to use for displaying text. * * @requires textField */ textFont: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.string), PropTypes.array, ]), /** * Font size. * * @requires textField */ textSize: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The maximum line width for text wrapping. * * @requires textField */ textMaxWidth: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * Text leading value for multiLine text. * * @requires textField */ textLineHeight: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * Text tracking amount. * * @requires textField */ textLetterSpacing: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * Text justification options. * * @requires textField */ textJustify: PropTypes.oneOfType([ PropTypes.oneOf(['auto', 'left', 'center', 'right']), PropTypes.array, ]), /** * Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `textVariableAnchor`, which defaults to using the twoDimensional `textOffset` if present. * * @requires textField */ textRadialOffset: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * To increase the chance of placing highPriority labels on the map, you can provide an array of `textAnchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `textJustify: auto` to choose justification based on anchor position. To apply an offset, use the `textRadialOffset` or the twoDimensional `textOffset`. * * @requires textField */ textVariableAnchor: PropTypes.array, /** * Part of the text placed closest to the anchor. * * @requires textField * * @disabledBy textVariableAnchor */ textAnchor: PropTypes.oneOfType([ PropTypes.oneOf(['center', 'left', 'right', 'top', 'bottom', 'top-left', 'top-right', 'bottom-left', 'bottom-right']), PropTypes.array, ]), /** * Maximum angle change between adjacent characters. * * @requires textField */ textMaxAngle: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant. * * @requires textField */ textWritingMode: PropTypes.array, /** * Rotates the text clockwise. * * @requires textField */ textRotate: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * Size of the additional area around the text bounding box used for detecting symbol collisions. * * @requires textField */ textPadding: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * If true, the text may be flipped vertically to prevent it from being rendered upsideDown. * * @requires textField */ textKeepUpright: PropTypes.oneOfType([ PropTypes.bool, PropTypes.array, ]), /** * Specifies how to capitalize text, similar to the CSS `textTransform` property. * * @requires textField */ textTransform: PropTypes.oneOfType([ PropTypes.oneOf(['none', 'uppercase', 'lowercase']), PropTypes.array, ]), /** * Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with textVariableAnchor, input values will be taken as absolute values. Offsets along the x and yAxis will be applied automatically based on the anchor position. * * @requires textField * * @disabledBy textRadialOffset */ textOffset: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.number), PropTypes.array, ]), /** * If true, the text will be visible even if it collides with other previously drawn symbols. * * @requires textField */ textAllowOverlap: PropTypes.oneOfType([ PropTypes.bool, PropTypes.array, ]), /** * If true, other symbols can be visible even if they collide with the text. * * @requires textField */ textIgnorePlacement: PropTypes.oneOfType([ PropTypes.bool, PropTypes.array, ]), /** * 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.bool, PropTypes.array, ]), /** * Whether this layer is displayed. */ visibility: PropTypes.oneOf(['visible', 'none']), /** * The opacity at which the icon will be drawn. * * @requires iconImage */ iconOpacity: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s iconOpacity property. */ iconOpacityTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The color of the icon. This can only be used with sdf icons. * * @requires iconImage */ iconColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s iconColor property. */ iconColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The color of the icon's halo. Icon halos can only be used with SDF icons. * * @requires iconImage */ iconHaloColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s iconHaloColor property. */ iconHaloColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Distance of halo to the icon outline. * * @requires iconImage */ iconHaloWidth: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s iconHaloWidth property. */ iconHaloWidthTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Fade out the halo towards the outside. * * @requires iconImage */ iconHaloBlur: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s iconHaloBlur property. */ iconHaloBlurTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * 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([ PropTypes.arrayOf(PropTypes.number), PropTypes.array, ]), /** * The transition affecting any changes to this layer’s iconTranslate property. */ iconTranslateTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Controls the frame of reference for `iconTranslate`. * * @requires iconImage, iconTranslate */ iconTranslateAnchor: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport']), PropTypes.array, ]), /** * The opacity at which the text will be drawn. * * @requires textField */ textOpacity: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s textOpacity property. */ textOpacityTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The color with which the text will be drawn. * * @requires textField */ textColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s textColor property. */ textColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The color of the text's halo, which helps it stand out from backgrounds. * * @requires textField */ textHaloColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s textHaloColor property. */ textHaloColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Distance of halo to the font outline. Max text halo width is 1/4 of the fontSize. * * @requires textField */ textHaloWidth: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s textHaloWidth property. */ textHaloWidthTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The halo's fadeout distance towards the outside. * * @requires textField */ textHaloBlur: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s textHaloBlur property. */ textHaloBlurTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * 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([ PropTypes.arrayOf(PropTypes.number), PropTypes.array, ]), /** * The transition affecting any changes to this layer’s textTranslate property. */ textTranslateTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Controls the frame of reference for `textTranslate`. * * @requires textField, textTranslate */ textTranslateAnchor: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport']), PropTypes.array, ]), }); export const CircleLayerStyleProp = PropTypes.shape({ /** * Whether this layer is displayed. */ visibility: PropTypes.oneOf(['visible', 'none']), /** * Circle radius. */ circleRadius: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s circleRadius property. */ circleRadiusTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The fill color of the circle. */ circleColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s circleColor property. */ circleColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity. */ circleBlur: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s circleBlur property. */ circleBlurTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The opacity at which the circle will be drawn. */ circleOpacity: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s circleOpacity property. */ circleOpacityTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. */ circleTranslate: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.number), PropTypes.array, ]), /** * The transition affecting any changes to this layer’s circleTranslate property. */ circleTranslateTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Controls the frame of reference for `circleTranslate`. * * @requires circleTranslate */ circleTranslateAnchor: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport']), PropTypes.array, ]), /** * Controls the scaling behavior of the circle when the map is pitched. */ circlePitchScale: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport']), PropTypes.array, ]), /** * Orientation of circle when map is pitched. */ circlePitchAlignment: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport']), PropTypes.array, ]), /** * The width of the circle's stroke. Strokes are placed outside of the `circleRadius`. */ circleStrokeWidth: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s circleStrokeWidth property. */ circleStrokeWidthTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The stroke color of the circle. */ circleStrokeColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s circleStrokeColor property. */ circleStrokeColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The opacity of the circle's stroke. */ circleStrokeOpacity: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s circleStrokeOpacity property. */ circleStrokeOpacityTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), }); export const HeatmapLayerStyleProp = PropTypes.shape({ /** * Whether this layer is displayed. */ visibility: PropTypes.oneOf(['visible', 'none']), /** * Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. */ heatmapRadius: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s heatmapRadius property. */ heatmapRadiusTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering. */ heatmapWeight: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * Similar to `heatmapWeight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level. */ heatmapIntensity: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s heatmapIntensity property. */ heatmapIntensityTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmapDensity"]` as input. */ heatmapColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The global opacity at which the heatmap layer will be drawn. */ heatmapOpacity: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s heatmapOpacity property. */ heatmapOpacityTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), }); export const FillExtrusionLayerStyleProp = PropTypes.shape({ /** * Whether this layer is displayed. */ visibility: PropTypes.oneOf(['visible', 'none']), /** * 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, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s fillExtrusionOpacity property. */ fillExtrusionOpacityTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * 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, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s fillExtrusionColor property. */ fillExtrusionColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively. */ fillExtrusionTranslate: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.number), PropTypes.array, ]), /** * The transition affecting any changes to this layer’s fillExtrusionTranslate property. */ fillExtrusionTranslateTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Controls the frame of reference for `fillExtrusionTranslate`. * * @requires fillExtrusionTranslate */ fillExtrusionTranslateAnchor: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport']), PropTypes.array, ]), /** * 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). Note that zoomDependent expressions will be evaluated only at integer zoom levels. */ fillExtrusionPattern: PropTypes.oneOfType([ PropTypes.number, PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s fillExtrusionPattern property. */ fillExtrusionPatternTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The height with which to extrude this layer. */ fillExtrusionHeight: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s fillExtrusionHeight property. */ fillExtrusionHeightTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * 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, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s fillExtrusionBase property. */ fillExtrusionBaseTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), }); export const RasterLayerStyleProp = PropTypes.shape({ /** * Whether this layer is displayed. */ visibility: PropTypes.oneOf(['visible', 'none']), /** * The opacity at which the image will be drawn. */ rasterOpacity: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s rasterOpacity property. */ rasterOpacityTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Rotates hues around the color wheel. */ rasterHueRotate: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s rasterHueRotate property. */ rasterHueRotateTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Increase or reduce the brightness of the image. The value is the minimum brightness. */ rasterBrightnessMin: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s rasterBrightnessMin property. */ rasterBrightnessMinTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Increase or reduce the brightness of the image. The value is the maximum brightness. */ rasterBrightnessMax: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s rasterBrightnessMax property. */ rasterBrightnessMaxTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Increase or reduce the saturation of the image. */ rasterSaturation: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s rasterSaturation property. */ rasterSaturationTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Increase or reduce the contrast of the image. */ rasterContrast: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s rasterContrast property. */ rasterContrastTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The resampling/interpolation method to use for overscaling, also known as texture magnification filter */ rasterResampling: PropTypes.oneOfType([ PropTypes.oneOf(['linear', 'nearest']), PropTypes.array, ]), /** * Fade duration when a new tile is added. */ rasterFadeDuration: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), }); export const HillshadeLayerStyleProp = PropTypes.shape({ /** * Whether this layer is displayed. */ visibility: PropTypes.oneOf(['visible', 'none']), /** * The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshadeIlluminationAnchor` is set to `viewport` and due north if `hillshadeIlluminationAnchor` is set to `map`. */ hillshadeIlluminationDirection: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * Direction of light source when map is rotated. */ hillshadeIlluminationAnchor: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport']), PropTypes.array, ]), /** * Intensity of the hillshade */ hillshadeExaggeration: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s hillshadeExaggeration property. */ hillshadeExaggerationTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The shading color of areas that face away from the light source. */ hillshadeShadowColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s hillshadeShadowColor property. */ hillshadeShadowColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The shading color of areas that faces towards the light source. */ hillshadeHighlightColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s hillshadeHighlightColor property. */ hillshadeHighlightColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The shading color used to accentuate rugged terrain like sharp cliffs and gorges. */ hillshadeAccentColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s hillshadeAccentColor property. */ hillshadeAccentColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), }); export const BackgroundLayerStyleProp = PropTypes.shape({ /** * Whether this layer is displayed. */ visibility: PropTypes.oneOf(['visible', 'none']), /** * The color with which the background will be drawn. * * @disabledBy backgroundPattern */ backgroundColor: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s backgroundColor property. */ backgroundColorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * 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). Note that zoomDependent expressions will be evaluated only at integer zoom levels. */ backgroundPattern: PropTypes.oneOfType([ PropTypes.number, PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s backgroundPattern property. */ backgroundPatternTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * The opacity at which the background will be drawn. */ backgroundOpacity: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s backgroundOpacity property. */ backgroundOpacityTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), }); export const LightLayerStyleProp = PropTypes.shape({ /** * Whether extruded geometries are lit relative to the map or viewport. */ anchor: PropTypes.oneOfType([ PropTypes.oneOf(['map', 'viewport']), PropTypes.array, ]), /** * 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), PropTypes.array, ]), /** * The transition affecting any changes to this layer’s position property. */ positionTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Color tint for lighting extruded geometries. */ color: PropTypes.oneOfType([ PropTypes.string, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s color property. */ colorTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), /** * Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast. */ intensity: PropTypes.oneOfType([ PropTypes.number, PropTypes.array, ]), /** * The transition affecting any changes to this layer’s intensity property. */ intensityTransition: PropTypes.shape({ duration: PropTypes.number, delay: PropTypes.number, }), }); 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.Enum, fillPattern: StyleTypes.Image, fillPatternTransition: StyleTypes.Transition, lineCap: StyleTypes.Enum, lineJoin: StyleTypes.Enum, 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.Enum, 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, lineGradient: StyleTypes.Color, symbolPlacement: StyleTypes.Enum, symbolSpacing: StyleTypes.Constant, symbolAvoidEdges: StyleTypes.Constant, symbolSortKey: StyleTypes.Constant, symbolZOrder: StyleTypes.Enum, iconAllowOverlap: StyleTypes.Constant, iconIgnorePlacement: StyleTypes.Constant, iconOptional: StyleTypes.Constant, iconRotationAlignment: StyleTypes.Enum, iconSize: StyleTypes.Constant, iconTextFit: StyleTypes.Enum, iconTextFitPadding: StyleTypes.Constant, iconImage: StyleTypes.Image, iconRotate: StyleTypes.Constant, iconPadding: StyleTypes.Constant, iconKeepUpright: StyleTypes.Constant, iconOffset: StyleTypes.Constant, iconAnchor: StyleTypes.Enum, iconPitchAlignment: StyleTypes.Enum, textPitchAlignment: StyleTypes.Enum, textRotationAlignment: StyleTypes.Enum, textField: StyleTypes.Constant, textFont: StyleTypes.Constant, textSize: StyleTypes.Constant, textMaxWidth: StyleTypes.Constant, textLineHeight: StyleTypes.Constant, textLetterSpacing: StyleTypes.Constant, textJustify: StyleTypes.Enum, textRadialOffset: StyleTypes.Constant, textVariableAnchor: StyleTypes.Constant, textAnchor: StyleTypes.Enum, textMaxAngle: StyleTypes.Constant, textWritingMode: StyleTypes.Constant, textRotate: StyleTypes.Constant, textPadding: StyleTypes.Constant, textKeepUpright: StyleTypes.Constant, textTransform: StyleTypes.Enum, 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.Enum, 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.Enum, 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.Enum, circlePitchScale: StyleTypes.Enum, circlePitchAlignment: StyleTypes.Enum, circleStrokeWidth: StyleTypes.Constant, circleStrokeWidthTransition: StyleTypes.Transition, circleStrokeColor: StyleTypes.Color, circleStrokeColorTransition: StyleTypes.Transition, circleStrokeOpacity: StyleTypes.Constant, circleStrokeOpacityTransition: StyleTypes.Transition, heatmapRadius: StyleTypes.Constant, heatmapRadiusTransition: StyleTypes.Transition, heatmapWeight: StyleTypes.Constant, heatmapIntensity: StyleTypes.Constant, heatmapIntensityTransition: StyleTypes.Transition, heatmapColor: StyleTypes.Color, heatmapOpacity: StyleTypes.Constant, heatmapOpacityTransition: StyleTypes.Transition, fillExtrusionOpacity: StyleTypes.Constant, fillExtrusionOpacityTransition: StyleTypes.Transition, fillExtrusionColor: StyleTypes.Color, fillExtrusionColorTransition: StyleTypes.Transition, fillExtrusionTranslate: StyleTypes.Translation, fillExtrusionTranslateTransition: StyleTypes.Transition, fillExtrusionTranslateAnchor: StyleTypes.Enum, 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, rasterResampling: StyleTypes.Enum, rasterFadeDuration: StyleTypes.Constant, hillshadeIlluminationDirection: StyleTypes.Constant, hillshadeIlluminationAnchor: StyleTypes.Enum, hillshadeExaggeration: StyleTypes.Constant, hillshadeExaggerationTransition: StyleTypes.Transition, hillshadeShadowColor: StyleTypes.Color, hillshadeShadowColorTransition: StyleTypes.Transition, hillshadeHighlightColor: StyleTypes.Color, hillshadeHighlightColorTransition: StyleTypes.Transition, h