Skip to content

tilelayer图层透明度问题 #2497

Closed
@GIS-Dong

Description

@GIS-Dong

当tilelayer同时设置透明度和mask时,透明度失效,removeMask后透明度有效

const maskedLayer = new TileLayer("carto", {
opacity: 0.6, // TileLayer's opacity, 0-1
urlTemplate: "https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",
subdomains: ["a", "b", "c", "d"],
attribution: "© OpenStreetMap contributors, © CARTO",
})
.setMask(mask)
.addTo(this.map);
setTimeout(() => {
maskedLayer.removeMask();
}, 3333);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions