Class: CircleFill
default.CircleFill
创建填充的圆或圆弧
Hierarchy
-
↳ CircleFill
Table of contents
Constructors
Properties
Methods
- addTo
- clickLayer
- clickPopup
- getCenter
- getData
- getEndAngle
- getFillAntialias
- getFillColor
- getFillOpacity
- getFillOutlineColor
- getFillPattern
- getFillSortKey
- getFillTranslate
- getFillTranslateAnchor
- getLayerId
- getLayerStyle
- getPoints
- getRadius
- getSourceId
- getStartAngle
- hide
- hoverFeatureState
- hoverLayer
- hoverPointer
- hoverPopup
- remove
- setCenter
- setData
- setEndAngle
- setFillAntialias
- setFillColor
- setFillOpacity
- setFillOutlineColor
- setFillPattern
- setFillSortKey
- setFillTranslate
- setFillTranslateAnchor
- setFilter
- setLayerStyle
- setPoints
- setProperty
- setRadius
- setStartAngle
- show
- toggle
- updateData
Constructors
constructor
+ new CircleFill(options: CircleFillOptions): CircleFill
Parameters
| Name | Type |
|---|---|
options |
CircleFillOptions |
Returns: CircleFill
Overrides: Polygon
Properties
_map
• Optional _map: Map
layerId
• Optional layerId: string
Inherited from: Polygon.layerId
options
• options: PolygonOptions
Inherited from: Polygon.options
sourceId
• Optional sourceId: string
Inherited from: Polygon.sourceId
Methods
addTo
▸ addTo(map: Map, beforeId?: string): void
Parameters
| Name | Type |
|---|---|
map |
Map |
beforeId? |
string |
Returns: void
Overrides: Polygon
clickLayer
▸ clickLayer(cb: any): any
每当单击这些图层中的要素时都会触发回调。
Parameters
| Name | Type | Description |
|---|---|---|
cb |
any | Callback that receives event with .features property |
Returns: any
A function that removes the handler.
Inherited from: Polygon
clickPopup
▸ clickPopup(htmlFunc: (arg0: {}) => void, popupOptions?: PopupOptions): any
每当单击这些图层中的要素时都会显示一个弹出窗口。
example clickPopup(f => <h3>${f.properties.Name}</h3> ${f.properties.Description}, { maxWidth: 500 });
Parameters
| Name | Type | Description |
|---|---|---|
htmlFunc |
(arg0: {}) => void |
Function that receives feature and popup, returns HTML. |
popupOptions? |
PopupOptions | Options passed to Popup() to customise popup. |
Returns: any
A function that removes the handler.
Inherited from: Polygon
getCenter
▸ getCenter(): GeoPointLike
得到中心点。
Returns: GeoPointLike
getData
▸ getData(): undefined | Feature<Geometry | GeometryCollection, Properties> | FeatureCollection<Geometry | GeometryCollection, Properties> | Geometry | GeometryCollection
获取数据源的数据
Returns: undefined | Feature<Geometry | GeometryCollection, Properties> | FeatureCollection<Geometry | GeometryCollection, Properties> | Geometry | GeometryCollection
Inherited from: Polygon
getEndAngle
▸ getEndAngle(): number
得到结束角度。
Returns: number
getFillAntialias
▸ getFillAntialias(): PropertyValueSpecificationEx<boolean>
获取图层的“填充抗锯齿”绘制属性。
Returns: PropertyValueSpecificationEx<boolean>
Inherited from: Polygon
getFillColor
▸ getFillColor(): DataDrivenPropertyValueSpecification<string>
获取图层的 fill-color 绘制属性。
Returns: DataDrivenPropertyValueSpecification<string>
Inherited from: Polygon
getFillOpacity
▸ getFillOpacity(): DataDrivenPropertyValueSpecification<number>
获取图层的 fill-opacity 绘制属性。
Returns: DataDrivenPropertyValueSpecification<number>
Inherited from: Polygon
getFillOutlineColor
▸ getFillOutlineColor(): DataDrivenPropertyValueSpecification<string>
获取图层的 fill-outline-color 绘制属性。
Returns: DataDrivenPropertyValueSpecification<string>
Inherited from: Polygon
getFillPattern
▸ getFillPattern(): DataDrivenPropertyValueSpecification<string>
获取图层的fill-pattern 绘制属性。
Returns: DataDrivenPropertyValueSpecification<string>
Inherited from: Polygon
getFillSortKey
▸ getFillSortKey(): DataDrivenPropertyValueSpecification<number>
获取图层的fill-sort-key 布局属性.
Returns: DataDrivenPropertyValueSpecification<number>
Inherited from: Polygon
getFillTranslate
▸ getFillTranslate(): PropertyValueSpecificationEx<[number, number]>
获取图层的 fill-translate 绘制属性。
Returns: PropertyValueSpecificationEx<[number, number]>
Inherited from: Polygon
getFillTranslateAnchor
▸ getFillTranslateAnchor(): PropertyValueSpecificationEx<"map" | "viewport">
获取图层的 fill-translate-anchor 绘制属性。
Returns: PropertyValueSpecificationEx<"map" | "viewport">
Inherited from: Polygon
getLayerId
▸ getLayerId(): undefined | string
获取图层ID
Returns: undefined | string
Inherited from: Polygon
getLayerStyle
▸ getLayerStyle(): LayerSpecification
根据样式规范,获取给定图层 ID 的图层定义。
Returns: LayerSpecification
Inherited from: Polygon
getPoints
▸ getPoints(): number
得到离散化的点的个数。
Returns: number
getRadius
▸ getRadius(): number
得到半径。
Returns: number
getSourceId
▸ getSourceId(): undefined | string
获取数据源ID
Returns: undefined | string
Inherited from: Polygon
getStartAngle
▸ getStartAngle(): number
得到开始角度。
Returns: number
hide
▸ hide(): void
使给定的图层不可见。
Returns: void
Inherited from: Polygon
hoverFeatureState
▸ hoverFeatureState(enterCb?: (arg0: {}) => void, leaveCb?: (arg0: {}) => void): void
每当将鼠标悬停在这些图层中的某个特征上时,更新连接源 [s] 中特征的特征状态。
Parameters
| Name | Type |
|---|---|
enterCb? |
(arg0: {}) => void |
leaveCb? |
(arg0: {}) => void |
Returns: void
Inherited from: Polygon
hoverLayer
▸ hoverLayer(cb: any): any
当鼠标悬停在这些图层中的要素上时触发回调。
Parameters
| Name | Type |
|---|---|
cb |
any |
Returns: any
A function to remove the handler.
Inherited from: Polygon
hoverPointer
▸ hoverPointer(): void
每当鼠标悬停在这些图层上时,将地图的光标设置为“指针”。
Returns: void
A function to remove the handler.
Inherited from: Polygon
hoverPopup
▸ hoverPopup(htmlFunc: any, popupOptions?: PopupOptions): any
将鼠标悬停在这些图层中的某个要素上时,会显示一个弹出窗口。
example hoverPopup(f => <h3>${f.properties.Name}</h3> ${f.properties.Description}, { anchor: 'left' });
Parameters
| Name | Type | Description |
|---|---|---|
htmlFunc |
any | Function that receives feature and popup, returns HTML. |
popupOptions? |
PopupOptions | Options passed to Popup() to customise popup. |
Returns: any
Inherited from: Polygon
remove
▸ remove(): void
Returns: void
Inherited from: Polygon
setCenter
▸ setCenter(value: GeoPointLike, bFocusUpdateData?: boolean): CircleFill
设置中心点。
Parameters
| Name | Type | Default value |
|---|---|---|
value |
GeoPointLike | - |
bFocusUpdateData |
boolean | true |
Returns: CircleFill
setData
▸ setData(data: any): void
替换 GeoJSON 图层的当前数据。
Parameters
| Name | Type |
|---|---|
data |
any |
Returns: void
Inherited from: Polygon
setEndAngle
▸ setEndAngle(value: number, bFocusUpdateData?: boolean): CircleFill
设置结束角度。
Parameters
| Name | Type | Default value |
|---|---|---|
value |
number | - |
bFocusUpdateData |
boolean | true |
Returns: CircleFill
setFillAntialias
▸ setFillAntialias(value: PropertyValueSpecificationEx<boolean>): CircleFill
为一个或多个图层设置fill-antialias 绘制属性。
Parameters
| Name | Type |
|---|---|
value |
PropertyValueSpecificationEx<boolean> |
Returns: CircleFill
Inherited from: Polygon
setFillColor
▸ setFillColor(value: DataDrivenPropertyValueSpecification<string>): CircleFill
为一个或多个图层设置fill-color 绘画属性。
Parameters
| Name | Type |
|---|---|
value |
DataDrivenPropertyValueSpecification<string> |
Returns: CircleFill
Inherited from: Polygon
setFillOpacity
▸ setFillOpacity(value: DataDrivenPropertyValueSpecification<number>): CircleFill
为一个或多个图层设置fill-opacity 绘画属性。
Parameters
| Name | Type |
|---|---|
value |
DataDrivenPropertyValueSpecification<number> |
Returns: CircleFill
Inherited from: Polygon
setFillOutlineColor
▸ setFillOutlineColor(value: DataDrivenPropertyValueSpecification<string>): CircleFill
为一个或多个图层设置fill-outline-color 绘画属性。
Parameters
| Name | Type |
|---|---|
value |
DataDrivenPropertyValueSpecification<string> |
Returns: CircleFill
Inherited from: Polygon
setFillPattern
▸ setFillPattern(value: DataDrivenPropertyValueSpecification<string>): CircleFill
为一个或多个图层设置fill-pattern 绘制属性。
Parameters
| Name | Type |
|---|---|
value |
DataDrivenPropertyValueSpecification<string> |
Returns: CircleFill
Inherited from: Polygon
setFillSortKey
▸ setFillSortKey(value: DataDrivenPropertyValueSpecification<number>): CircleFill
为一层或多层设置fill-sort-key布局属性。
Parameters
| Name | Type |
|---|---|
value |
DataDrivenPropertyValueSpecification<number> |
Returns: CircleFill
Inherited from: Polygon
setFillTranslate
▸ setFillTranslate(value: DataDrivenPropertyValueSpecification<string>): CircleFill
为一个或多个图层设置fill-translate 绘制属性。
Parameters
| Name | Type |
|---|---|
value |
DataDrivenPropertyValueSpecification<string> |
Returns: CircleFill
Inherited from: Polygon
setFillTranslateAnchor
▸ setFillTranslateAnchor(value: PropertyValueSpecificationEx<"map" | "viewport">): CircleFill
为一个或多个图层设置fill-translate-anchor 绘制属性。
Parameters
| Name | Type |
|---|---|
value |
PropertyValueSpecificationEx<"map" | "viewport"> |
Returns: CircleFill
Inherited from: Polygon
setFilter
▸ setFilter(filter: FilterSpecification): void
替换一个图层的过滤器。
example setFilter(['==','level','0']]);
Parameters
| Name | Type | Description |
|---|---|---|
filter |
FilterSpecification | New filter to set. |
Returns: void
Inherited from: Polygon
setLayerStyle
▸ setLayerStyle(style: any): void
设置图层样式
Parameters
| Name | Type |
|---|---|
style |
any |
Returns: void
Inherited from: Polygon
setPoints
▸ setPoints(value: number, bFocusUpdateData?: boolean): CircleFill
设置离散化的点的个数。
Parameters
| Name | Type | Default value |
|---|---|---|
value |
number | - |
bFocusUpdateData |
boolean | true |
Returns: CircleFill
setProperty
▸ setProperty(prop: string | object, value?: any): void
在一个或多个图层上设置绘制或布局属性。
example setProperty('fillOpacity', 0.5)
Parameters
| Name | Type |
|---|---|
prop |
string | object |
value? |
any |
Returns: void
Inherited from: Polygon
setRadius
▸ setRadius(value: number, bFocusUpdateData?: boolean): CircleFill
设置半径。
Parameters
| Name | Type | Default value |
|---|---|---|
value |
number | - |
bFocusUpdateData |
boolean | true |
Returns: CircleFill
setStartAngle
▸ setStartAngle(value: number, bFocusUpdateData?: boolean): CircleFill
设置开始角度。
Parameters
| Name | Type | Default value |
|---|---|---|
value |
number | - |
bFocusUpdateData |
boolean | true |
Returns: CircleFill
show
▸ show(): void
使给定的图层可见。
Returns: void
Inherited from: Polygon
toggle
▸ toggle(state: boolean): boolean
根据参数使给定的图层隐藏或可见。
Parameters
| Name | Type | Description |
|---|---|---|
state |
boolean | True for visible, false for hidden. |
Returns: boolean
Inherited from: Polygon
updateData
▸ updateData(): void
Returns: void