#
vincentlu
2025-12-09 9dff81608258d1b24a1ed6ba36194875ce4bb72c
zy-acs-flow/src/map/tool.js
@@ -854,3 +854,25 @@
    mapContainer.addChild(agvPath);
}
export const removeAgvGraphics = () => {
    if (!mapContainer) {
        return;
    }
    for (let i = mapContainer.children.length - 1; i >= 0; i--) {
        const child = mapContainer.children[i];
        if (child?.data?.type === DEVICE_TYPE.AGV) {
            if (child.data.jobEffect) {
                app?.ticker.remove(child.data.jobEffect._onTick);
                child.removeChild(child.data.jobEffect);
                child.data.jobEffect.destroy(true);
                child.data.jobEffect = null;
            }
            mapContainer.removeChild(child);
            child.destroy({ children: true, texture: false, baseTexture: false });
        } else if (child?.name?.startsWith('agvPath-')) {
            mapContainer.removeChild(child);
            child.destroy({ children: true, texture: false, baseTexture: false });
        }
    }
}