<MapboxGL.CircleLayer />
CircleLayer is a style layer that renders one or more filled circles on the map.
圆形图层是在地图上渲染一个或多个实心圆的样式图层。
props
Prop | Type | Default | Required |
---|---|---|---|
id | string |
none |
false |
A string that uniquely identifies the source in the style to which it is added.
在添加到的样式中唯一标识源的字符串。
sourceID | string |
MapboxGL.StyleSource.DefaultSourceID |
false |
---|
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.
从中获取要设置样式的数据的源。如果源尚未添加到当前样式,则行为未定义。
sourceLayerID | string |
none |
false |
---|
Identifier of the layer within the source identified by the sourceID property from which the receiver obtains the data to style.
由sourceID属性标识的源中的层的标识符,接收方从中获取要样式的数据。
aboveLayerID | string |
none |
false |
---|
Inserts a layer above aboveLayerID.
在overveLayerID上方插入一个图层。
belowLayerID | string |
none |
false |
---|
Inserts a layer below belowLayerID
在belowLayerID 下面插入一个图层。
layerIndex | number |
none |
false |
---|
Inserts a layer at a specified index
在指定索引处插入图层
filter | array |
none |
false |
---|
Filter only the features in the source layer that satisfy a condition that you define
仅过滤源图层中满足您定义的条件的要素
minZoomLevel | number |
none |
false |
---|
The minimum zoom level at which the layer gets parsed and appears.
对图层进行解析并显示的最低缩放级别。
maxZoomLevel | number |
none |
false |
---|
The maximum zoom level at which the layer gets parsed and appears.
对图层进行解析并显示的最大缩放级别。
style | union |
none |
false |
---|
Customizable style attributes
可自定义的样式属性
styles
- <a href="#name">visibility</a>
- <a href="#name-1">circleRadius</a>
- <a href="#name-2">circleColor</a>
- <a href="#name-3">circleBlur</a>
- <a href="#name-4">circleOpacity</a>
- <a href="#name-5">circleTranslate</a>
- <a href="#name-6">circleTranslateAnchor</a>
- <a href="#name-7">circlePitchScale</a>
- <a href="#name-8">circlePitchAlignment</a>
- <a href="#name-9">circleStrokeWidth</a>
- <a href="#name-10">circleStrokeColor</a>
- <a href="#name-11">circleStrokeOpacity</a>
Name
visibility
Description
Whether this layer is displayed.
Type
enum
Default Value
visible
Supported Values
visible - The layer is shown.<br />
none - The layer is not shown.<br />
Name
circleRadius
Description
Circle radius.
Type
number
Default Value
5
Units
pixels
Minimum
0
Expression
Parameters: zoom, feature, feature-state
Name
circleColor
Description
The fill color of the circle.
Type
color
Default Value
#000000
Expression
Parameters: zoom, feature, feature-state
Name
circleBlur
Description
Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
Type
number
Default Value
0
Expression
Parameters: zoom, feature, feature-state
Name
circleOpacity
Description
The opacity at which the circle will be drawn.
Type
number
Default Value
1
Minimum
0
Maximum
1
Expression
Parameters: zoom, feature, feature-state
Name
circleTranslate
Description
The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
Type
array<number>
Default Value
[0,0]
Units
pixels
Expression
Parameters: zoom
Name
circleTranslateAnchor
Description
Controls the frame of reference for circleTranslate
.
Type
enum
Default Value
map
Supported Values
map - The circle is translated relative to the map.<br />
viewport - The circle is translated relative to the viewport.<br />
Requires
circleTranslate
Expression
Parameters: zoom
Name
circlePitchScale
Description
Controls the scaling behavior of the circle when the map is pitched.
Type
enum
Default Value
map
Supported Values
map - Circles are scaled according to their apparent distance to the camera.<br />
viewport - Circles are not scaled.<br />
Expression
Parameters: zoom
Name
circlePitchAlignment
Description
Orientation of circle when map is pitched.
地图倾斜时圆的方向。
Type
enum
Default Value
viewport
Supported Values
map - The circle is aligned to the plane of the map.与地图的平面对齐
viewport - The circle is aligned to the plane of the viewport.与视口的平面对齐
Expression
Parameters: zoom
Name
circleStrokeWidth
Description
The width of the circle's stroke. Strokes are placed outside of the circleRadius
.
Type
number
Default Value
0
Units
pixels
Minimum
0
Expression
Parameters: zoom, feature, feature-state
Name
circleStrokeColor
Description
The stroke color of the circle.
Type
color
Default Value
#000000
Expression
Parameters: zoom, feature, feature-state
Name
circleStrokeOpacity
Description
The opacity of the circle's stroke.
Type
number
Default Value
1
Minimum
0
Maximum
1
Expression
Parameters: zoom, feature, feature-state
网友评论