AI
产品服务
解决方案
文档与支持
定价
更新时间: 2026/03/23 17:27
添加文字
下载开发文档
文字覆盖物

文字(Text)在地图上也是一种覆盖物,由BMFText类定义,示例代码如下:

/// text经纬度信息
BMFCoordinate position = new BMFCoordinate(39.73235, 116.350338);
/// 构造text
BMFText bmfText = BMFText(
text: 'hello world',
position: position,
bgColor: Colors.blue,
fontColor: Colors.red,
fontSize: 40,
typeFace: BMFTypeFace( familyName: BMFFamilyName.sMonospace,
textStype: BMFTextStyle.BOLD_ITALIC),
alignY: BMFVerticalAlign.ALIGN_TOP,
alignX: BMFHorizontalAlign.ALIGN_LEFT,
rotate: 30.0);
/// 添加text
myMapController.addText(bmfText);

运行结果如下:

text.jpg

Text更新(Android独有)

接口说明

updateText

更新Text文本

updatePosition

更新Text经纬度

updateBgColor

更新Text背景颜色

updateFontColor

更新Text字体颜色

updateTypeFace

更新TexttypeFace

updateFontSize

更新Text字体大小

updateAlign

更新Text文字覆盖对齐方式

updateRotate

更新Text旋转角度

Dot更新(Android独有)

接口说明

updateCenter

更新中心点center

updateRadius

更新半径

updateColor

更新颜色

上一篇

绘制海量点

下一篇

绘制Overlay

本篇文章对您是否有帮助?