show()

in packages/layers/geojson/src/Polygon/PolygonLayer.ts [550:592]


	show(duration = 1000) {
		if (!this.inited) {
			console.warn('can not call .show until layer is inited')
			return
		}

		if (this.surfaceLayer) {
			this.surfaceLayer.matr.alphaMode = 'BLEND'
			this.surfaceLayer.matr.opacity = 0.0
		}
		if (this.sideLayer) {
			this.sideLayer.matr.alphaMode = 'BLEND'
			this.sideLayer.matr.opacity = 0.0
		}
		this.group.visible = true

		const timeline = this.timeline
		timeline.addTrack({
			id: 'PolygonLayer Show',
			startTime: timeline.currentTime,
			duration: duration,
			onStart: () => {},
			onEnd: () => {
				if (this.surfaceLayer) {
					this.surfaceLayer.matr.alphaMode = this.getProp('transparent') ? 'BLEND' : 'OPAQUE'
					this.surfaceLayer.matr.opacity = 1.0
				}
				if (this.sideLayer) {
					this.sideLayer.matr.alphaMode = this.getProp('transparent') ? 'BLEND' : 'OPAQUE'
					this.sideLayer.matr.opacity = 1.0
				}
				this.group.visible = true
			},
			onUpdate: (t, p) => {
				if (this.surfaceLayer) {
					this.surfaceLayer.matr.opacity = p
				}
				if (this.sideLayer) {
					this.sideLayer.matr.opacity = p
				}
			},
		})
	}