826220679@qq.com
2 天以前 64e0880d2d81ce2b3f0e366b1537c5efe2f2c4ea
src/zhuye/WangfanDraw.java
@@ -23,6 +23,7 @@
    // 绘制状态
    private boolean drawingActive = false;
    private boolean paused = false;
    private boolean isHandheldMode = false;  // 是否使用手持设备模式
    
    // 基准坐标
    private double[] baseLatLon;
@@ -63,9 +64,10 @@
    /**
     * 启动往返路径绘制
     * @param finishCallback 完成绘制时的回调
     * @param isHandheld 是否使用手持设备模式
     * @return 是否成功启动
     */
    public boolean start(Runnable finishCallback) {
    public boolean start(Runnable finishCallback, boolean isHandheld) {
        if (mapRenderer == null || helper == null) {
            return false;
        }
@@ -83,6 +85,12 @@
        paused = false;
        this.finishCallback = finishCallback;
        this.baseLatLon = baseLatLonCandidate;
        this.isHandheldMode = isHandheld;
        // 如果是手持设备模式,切换图标
        if (isHandheld && shouye != null) {
            shouye.setHandheldMowerIconActive(true);
        }
        // 清空路径点
        synchronized (returnPathPoints) {
@@ -101,6 +109,12 @@
        if (helper != null) {
            helper.enterDrawingControlMode();
        }
        // 设置状态提示为"正在绘制往返路径"
        if (shouye != null) {
            shouye.setStatusLabelText("正在绘制往返路径");
        }
        startMonitor();
        return true;
    }
@@ -245,6 +259,12 @@
        if (helper != null) {
            helper.exitDrawingControlMode();
        }
        // 恢复割草机图标
        if (isHandheldMode && shouye != null) {
            shouye.setHandheldMowerIconActive(false);
        }
        isHandheldMode = false;
    }
    
    /**