Skip to content

文本材料属性

文本需要额外调用接口,需要引用插件 TextMaterialProperty.js

HTML
<script src="SDK/Plugins/TextMaterialProperty.js"></script>

文本开始

JavaScript
var textWall = viewer.entities.add({
    name: "Green wall from surface",
    wall: {
        positions: LSGlobe.Cartesian3.fromDegreesArrayHeights([
            -107.0,
            43.0,
            1000.0,
            -107.1,
            43.0,
            1000.0,
        ]),
        material: new LSGlobe.TextMaterialProperty({
            text: "中科图新文字立体墙",
            font: "20px 楷体",
            fill: true,
            fillColor: LSGlobe.Color.ORANGE,
            stroke: true,
            strokeWidth: 2,
            strokeColor: LSGlobe.Color.RED,
            backgroundColor: LSGlobe.Color.TRANSPARENT,
            padding: 10
        }),
        outline: false,
    },
})

示例代码 code

code示例地址

Released under the MIT License.