#
luxiaotao1123
2024-11-26 c7ac2c8bb899b0785daaa9f72a69581bdb93fef1
zy-acs-flow/src/map/tool.js
@@ -72,11 +72,10 @@
export const getRealPosition = (x, y) => {
    const rect = app.view.getBoundingClientRect();
    return {
        mapX: (x - rect.left) / mapContainer.scale.x - mapContainer.x / mapContainer.scale.x,
        mapY: (y - rect.top) / mapContainer.scale.y - mapContainer.y / mapContainer.scale.y
    }
    const globalPoint = new PIXI.Point();
    app.renderer.plugins.interaction.mapPositionToPoint(globalPoint, x, y);
    const mapPoint = mapContainer.toLocal(globalPoint);
    return { mapX: mapPoint.x, mapY: mapPoint.y };
}
export const generateSprite = (deviceType, texture) => {
@@ -657,7 +656,7 @@
    }
}
const agvRotationOffsetDegrees = 0;
const agvRotationOffsetDegrees = 90;
const agvRotationOffset = rotationParseNum(agvRotationOffsetDegrees);
const showAgvSprite = (curZone, agvVo, setCurSprite) => {
@@ -684,7 +683,6 @@
        agvSprite.position.set(codeSprite.position.x, codeSprite.position.y);
        agvSprite.rotation = targetRotation + agvRotationOffset;
        mapContainer.addChild(agvSprite);
        beInsight(agvSprite, setCurSprite);
        // agvNo sprite
        const agvText = new PIXI.Text(agvNo.toString(), {
@@ -715,8 +713,10 @@
            agvSprite.data.battery = battery;
        }
        animateRotation(agvSprite, targetRotation, agvRotationOffset);
        animateRotation(agvSprite, targetRotation + agvRotationOffset, agvRotationOffset);
    }
    beInsight(agvSprite, setCurSprite);
    new TWEEDLE.Tween(agvSprite.position)
        .to({
@@ -740,7 +740,7 @@
    }
    agvPath = new PIXI.Graphics();
    agvPath.name = agvPathName;
    agvPath.lineStyle(Math.max(20, 4 * (1 / mapContainer.scale.x)), 0x2f68ac, 0.8);
    agvPath.lineStyle(Math.max(20, 4 * (1 / mapContainer?.scale.x || 1)), 0x2f68ac, 0.8);
    agvPath.zIndex = DEVICE_Z_INDEX.DYNAMIC_ROUTE;
    // agvPath.blendMode = PIXI.BLEND_MODES.NORMAL;