inputLayer는 SHP 파일을 통해 구성된 레이어임.
const cntRows = inputLayer.totalRowsCount(); for (let fid = 0; fid < cntRows; fid++) { const sRow = inputLayer.getShapeByFID(fid) const attributeValues = inputLayer.getAttributeByFID(fid) const pt = sRow.shapeData().representativePoint(); const tsd = new Xr.data.TextShapeData({ x: pt.x, y: pt.y, text: attributeValues[labelFieldIndex] }); const tgr = new Xr.data.TextGraphicRow(cntRows + fid, tsd); const fontSymbol = tgr.fontSymbol(); fontSymbol.color(this.#labelSymbol.fontColor); fontSymbol.size(this.#labelSymbol.fontSize); fontSymbol.strokeColor(this.#labelSymbol.fontStrokeColor); fontSymbol.weight(this.#labelSymbol.bBold ? "600" : undefined); fontSymbol.strokeWidth(this.#labelSymbol.fontStrokeWidth); gl.rowSet().add(tgr); }
4번과 5번 코드가 관련된 코드인데, attributeValues는 배열로서 해당 fid에 대한 값이 그 타입에 상관없이 문자열로 저장되어 있다.