更新时间:2026/02/27 14:50
通过Ground类,设置四至范围、纹理以及透明度,支持在底图上叠加地面覆盖物(自定义图片)。

示例代码:
代码
// 添加地面覆盖物const image:ImageEntity = new ImageEntity('rawfile://ground.png');this.ground = new Ground({ image: image, bounds: [new LatLng(35, 100), new LatLng(45, 120)], transparency: 0.8});this.ground.addEventListener(OverlayEvent.CLICK, () => { this.ground?.setBound(new LatLng(40, 100), new LatLng(50, 120)); promptAction.showToast({ message: '点击贴地覆盖物', duration: 2000, });});
this.map.addOverlay(this.ground);本篇文章对您是否有帮助?