LabelMarker

LabelMarker 需要与 LabelsLayer配合使用

<LabelsLayer>
<LabelMarker position={p} text={textOptions} />
</LabelsLayer>

Source Code

Props

LabelMarker Props

属性名类型备注
namestring
positionnumber[2]
zoomsnumber[2]
opacitynumber
ranknumber
zIndexnumber
visibleboolean
iconIconOptions下详
textTextOptions下详

IconOptions

属性名类型备注
sizenumber[2], AMap.Size
clipOriginnumber[2], AMap.Pixel
clipSizenumber[2], AMap.Size
anchorAnchor, number[2], AMap.Pixel*1
  1. Anchor'top-left'|'top-center'|'top-right'|'middle-left'|'center'|'middle-right'|'bottom-left'|'bottom-center'|'bottom-right'

TextOptions

属性名类型备注
contentstring
direction'top', 'right', 'bottom', 'left', 'center'
offsetnumber[2], AMap.Pixel
zoomsnumber[2]
styleTextStyleOptions下祥

TextStyleOptions

属性名类型备注
fontSizenumber
fillColorstring
strokeColorstring
paddingstring, number[]
backgroundColorstring
borderColorstring
borderWidthnumber
foldboolean

LabelsLayer Props

属性名类型备注
visibleboolean
zIndexnumber
opacitynumber
collisionboolean
allowCollisionboolean
zoomsnumber[2]

Events

LabelMarker Props

事件名备注
mousedown
mouseup
touchstart
touchmove
touchend
click
mousemove
mouseover
mouseout

Example

查看源代码: