private _genLineIndicators()

in packages/layers/geojson/src/Polygon/PolygonSurfaceLayer.ts [415:486]


	private _genLineIndicators(polaris, selectPosArr: number[][]) {
		// Hover indicator
		const hoverLineWidth = this.getProp('hoverLineWidth') as number
		const hoverLineColor = this.getProp('hoverLineColor')
		const hoverLineLevel = this.getProp('hoverLineLevel')
		let hoverLevel = hoverLineLevel
		if (hoverLineWidth > 1 && hoverLineLevel === 1) {
			hoverLevel = 2
		}
		const hoverLineConfig = {
			level: hoverLevel,
			opacity: 1.0,
			lineWidth: hoverLineWidth,
			useColors: true,
			resolution: {
				x: polaris.canvasWidth ?? polaris.width,
				y: polaris.canvasHeight ?? polaris.height,
			},
			usePerspective: false,
			dynamic: true,
			u: false,
			texture: undefined,
			renderOrder: this.getProp('renderOrder'),
			depthTest: true,
			transparent: true,
			// alphaTest: 0.0001,
		}
		const hoverIndicator = new LineIndicator(selectPosArr, hoverLineConfig, {
			defaultColor: new Color(0.0, 0.0, 0.0),
			defaultAlpha: 0.0,
			highlightColor: new Color(hoverLineColor),
			highlightAlpha: 1.0,
		})
		hoverIndicator.addToLayer(this)

		// Select indicator
		const selectLineWidth = this.getProp('selectLineWidth') as number
		const selectLineColor = this.getProp('selectLineColor')
		const selectLineLevel = this.getProp('selectLineLevel')
		let selectLevel = selectLineLevel
		if (selectLineWidth > 1 && selectLineLevel === 1) {
			selectLevel = 2
		}
		const selectLineConfig = {
			level: selectLevel,
			opacity: 1.0,
			lineWidth: selectLineWidth,
			useColors: true,
			resolution: {
				x: polaris.canvasWidth ?? polaris.width,
				y: polaris.canvasHeight ?? polaris.height,
			},
			usePerspective: false,
			dynamic: true,
			u: false,
			texture: undefined,
			renderOrder: this.getProp('renderOrder'),
			depthTest: true,
			transparent: true,
			// alphaTest: 0.0001,
		}
		const selectIndicator = new LineIndicator(selectPosArr, selectLineConfig, {
			defaultColor: new Color(0.0, 0.0, 0.0),
			defaultAlpha: 0.0,
			highlightColor: new Color(selectLineColor),
			highlightAlpha: 1.0,
		})
		selectIndicator.addToLayer(this)

		this.selectIndicator = selectIndicator
		this.hoverIndicator = hoverIndicator
	}