首页 / 浏览问题 / WebGIS / 问题详情
createTextWC怎么设置style
21EXP 2022年06月13日

var style = { fontSize:"50px"};

this.plottingLayer.createTextWC(this.btnText, new SuperMap.Geometry.Point(this.x, this.y),style);

向上面这样写为什么style不起作用?

1个回答

您好,我这边测试修改属性是可以生效的。

        var styletest = { fontSize:"200px"};
        var tata=plottingLayer.createTextWC("testText",new SuperMap.Geometry.Point(0,0),"id1",styletest);
        var findtext=plottingLayer.getFeatureByUuid("id1");
        //findtext.style.fontSize= "50px";
        plottingLayer.redraw();

希望可以帮助到您。

于丁
1
9,523EXP 2022年06月13日

var styletest = { fontSize:"200px"};

this.plottingLayer.createTextWC(this.btnText, new SuperMap.Geometry.Point(this.x, this.y),"",styletest);

您好,在styletest前面加个“”就生效了,是因为什么呢

createTextWC: function( content,
pos,
style )
uuid是要素的唯一标识属性,正常业务逻辑是必给属性才能正常使用。
...