#
luxiaotao1123
2024-10-16 991d8f88fc4644ec42f1d9febef2a11ef36dedd0
zy-acs-flow/src/map/tool.js
@@ -129,6 +129,10 @@
    }
}
export const findSpriteByUuid = (uuid) => {
    return mapContainer?.children?.find(child => child?.data?.uuid === uuid);
}
export const markSprite = (sprite) => {
    sprite.alpha = 0.5;
}
@@ -261,6 +265,33 @@
    function onClick(event) {
        setSpriteSettings(sprite);
    }
}
export const focusSprite = (sprite) => {
    if (!sprite || !app || !mapContainer) {
        return;
    }
    mapContainer.scale.set(0.3);
    mapContainer.position.set(0, 0);
    let bounds = sprite.getBounds();
    let focusPoint = {
        x: bounds.x + bounds.width / 2,
        y: bounds.y + bounds.height / 2
    };
    let targetPos = {
        x: app.renderer.width / 4 - focusPoint.x,
        y: app.renderer.height / 2 - focusPoint.y
    };
    new TWEEDLE.Tween(mapContainer.position)
        .easing(TWEEDLE.Easing.Quadratic.Out)
        .to(targetPos, 500)
        .onComplete(() => {
        })
        .start();
}
export const clearMapData = () => {
@@ -452,7 +483,7 @@
// dynamic graphic ----------------
export const generateDynamicGraphic = (curZone, data) => {
    console.log("ws", curZone, data);
    // console.log("ws", curZone, data);
    for (const agvVo of data.agvVos) {
        showAgvSprite(curZone, agvVo)
@@ -474,5 +505,6 @@
        agvSprite.rotation = rotationParseNum(direction);
        mapContainer.addChild(agvSprite);
        // viewFeature(shuttle, setCurSPrite); // todo
        // agv no on sprite
    }
}