in packages/layers/geojson/src/Polygon/PolygonLayer.ts [594:634]
hide(duration = 1000) {
if (!this.inited) {
console.warn('can not call .hide until layer is inited')
return
}
if (this.surfaceLayer) {
this.surfaceLayer.matr.alphaMode = 'BLEND'
this.surfaceLayer.matr.opacity = 1.0
}
if (this.sideLayer) {
this.sideLayer.matr.alphaMode = 'BLEND'
this.sideLayer.matr.opacity = 1.0
}
const timeline = this.timeline
timeline.addTrack({
id: 'PolygonLayer Hide',
startTime: timeline.currentTime,
duration: duration,
onStart: () => {},
onEnd: () => {
if (this.surfaceLayer) {
this.surfaceLayer.matr.alphaMode = this.getProp('transparent') ? 'BLEND' : 'OPAQUE'
this.surfaceLayer.matr.opacity = 0.0
}
if (this.sideLayer) {
this.sideLayer.matr.alphaMode = this.getProp('transparent') ? 'BLEND' : 'OPAQUE'
this.sideLayer.matr.opacity = 0.0
}
this.group.visible = false
},
onUpdate: (t, p) => {
if (this.surfaceLayer) {
this.surfaceLayer.matr.opacity = 1 - p
}
if (this.sideLayer) {
this.sideLayer.matr.opacity = 1 - p
}
},
})
}