FMapMarker 标记
FMapMarker 是声明式的标记组件,通过 type 区分图片与文字标记,卸载时自动移除。
tsx
import { FMapMarker, FMapLocationMarker } from '@indoor-map/fmap-react';
<>
<FMapMarker
type="image"
x={121.23}
y={31.02}
level={1}
url="/markers/pointer.png"
size={32}
/>
<FMapMarker
type="text"
x={121.25}
y={31.04}
text="服务台"
fontColor="#1890ff"
/>
<FMapLocationMarker x={121.20} y={31.00} level={1} followLocation />
</>;FMapMarker Props
| 属性 | 类型 | 说明 |
|---|---|---|
type | 'image' | 'text' | 标记类型 |
x / y | number | 地图坐标 |
level | number | 所在楼层 |
url | string(image) | 图片 URL |
size | number | 图标大小 |
text | string(text) | 文字内容 |
fontSize / fontColor / plateColor | 文字样式 |
FMapLocationMarker Props
| 属性 | 说明 |
|---|---|
x / y / level | 定位坐标与楼层 |
iconUrl / size | 定位图标与大小 |
showAccuracy / accuracy | 精度圈 |
followLocation | 地图中心跟随定位点 |
heading | 朝向角度 |