            const state = e.target.id;
                drawing = true;
                scanning = false;
                drawingState = state;
            }
        }

        function logResult() {
            if (drawingState === 'distance') {
                result.innerText = '当前距离为：' + calDistance(currentGeometry);
            } else if (drawingState === 'area') {
                result.innerText = '当前多边形面积: ' + calArea(currentGeometry);
            } else if (drawingState ===