Html5 canvas Openlayers html5画布文本粗体一个字
我正在开发一个应用程序,允许用户将文本添加到地图中。我正在使用OpenlayersHtml5 canvas Openlayers html5画布文本粗体一个字,html5-canvas,openlayers,Html5 Canvas,Openlayers,我正在开发一个应用程序,允许用户将文本添加到地图中。我正在使用Openlayersol.style.Text来实现这一点,请参见以下内容: text: new ol.style.Text({ text: "Your text \n on a new line", textAlign: 'left', textBaseline: 'bottom', offsetX: 10, offsetY: -5, scale: 1.5, placement: 'point', f
ol.style.Text
来实现这一点,请参见以下内容:
text: new ol.style.Text({
text: "Your text \n on a new line",
textAlign: 'left',
textBaseline: 'bottom',
offsetX: 10,
offsetY: -5,
scale: 1.5,
placement: 'point',
font: '12px sans-serif',
backgroundFill: new ol.style.Fill({
color: 'rgba(255,255,255,1)'
}),
backgroundStroke: new ol.style.Stroke({
color: 'rgba(0,0,0,1)',
width: 1
}),
padding: [5,5,5,5]
})
我知道我可以通过将font:'12px sans serif'
更改为font:'bold 12px sans serif'
我的问题是:有没有一种方法可以让一个词加粗(“行”)呢?相关问题(在gis.stackexchange.com上):