1
有没有办法为ollystyle.Text类设置openlayers 4+的多种字体颜色?Openlayers ol.style.Text与多种颜色
我试图做类似
const label = new ol.style.Style({
text: new ol.style.Text({
text: '<color1>X</color1> other text',
textAlign: 'center',
font: '11px roboto,sans-serif',
fill: new ol.style.Fill({
color: 'white'
}),
stroke: new ol.style.Stroke({
color: 'black',
lineCap: 'butt',
width: 4
}),
offsetX: 0,
offsetY: 25.5,
})
,因为“其他文本”的长度或宽度是未知的,textAlign设置必须设置为中心,我不能添加两个ol.style.Text类和位置他们并排。
在此先感谢