// marker
const marker = new Graphic()
marker.geometry = new Point(117.227239, 31.820586, new SpatialReference({ wkid: 4326 }))
marker.symbol = new TextSymbol({
text: '文本内容',
color: '#f00',
backgroundColor: [255, 255, 255, 1], // 内容框背景色
borderLineColor: [0, 0, 0, 1], // 边框色
borderLineSize: 1, // 边框大小
horizontalAlignment: 'center', // 水平方向对齐方式
verticalAlignment: 'middle', // 垂直方向对齐方式
xoffset: 0, // 正值向右
yoffset: 0, // 正值向上
font: {
size: 11,
family: 'Josefin Slab'
}
})
// GraphicsLayer
const layer = new GraphicsLayer({
id: '123456',
graphics: [marker]
})
window.customMap.map.add(layer)
02-14
1万+
08-02
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交