Skip to content

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 / ynumber地图坐标
levelnumber所在楼层
urlstring(image)图片 URL
sizenumber图标大小
textstring(text)文字内容
fontSize / fontColor / plateColor文字样式

FMapLocationMarker Props

属性说明
x / y / level定位坐标与楼层
iconUrl / size定位图标与大小
showAccuracy / accuracy精度圈
followLocation地图中心跟随定位点
heading朝向角度

基于蜂鸟视图 Fengmap SDK 构建