gpt4 book ai didi

javascript - 更改标线标签的颜色

转载 作者:行者123 更新时间:2023-11-30 13:18:49 25 4
gpt4 key购买 nike

我正在尝试更改我的 openlayers map 上标线标签的颜色,但我无法让它工作。这是我正在做的:

this.Graticule = new OpenLayers.Control.Graticule({
numPoints: 2,
labelled: true,
lineSymbolizer:{strokeColor: "#ffffff", strokeWidth: 1, strokeOpacity: 0.2},
labelSymbolizer:{strokeColor: "#ffffff", strokeWidth: 1, strokeOpacity: 0.7}
});

颜色线在变化,但我总是得到黑色标签。

有人可以帮我吗?

谢谢。

最佳答案

为了更改文本标签,您需要定义字体属性:

labelSymbolizer: {
fontColor: "#ffffff",
fontSize: "12px"
}

关于javascript - 更改标线标签的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11056702/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com