#
luxiaotao1123
2024-02-29 cef2b5c7fa9ad9287116ae7d6f07d74499acc388
zy-asrs-flow/src/pages/map/index.jsx
@@ -3,6 +3,12 @@
import * as TWEEDLE from 'tweedle.js';
import { Button, message, Modal, Card } from 'antd';
import './index.css'
import {
    FooterToolbar,
    PageContainer,
    ProTable,
    LightFilter,
} from '@ant-design/pro-components';
const Map = () => {
    const mapRef = React.useRef();
@@ -15,14 +21,11 @@
            antialias: true,
        })
    })
    app.stage.interactive = true;
    app.stage.hitArea = app.screen;
    globalThis.__PIXI_APP__ = app;
    mapRef.current.appendChild(app.view);
    React.useEffect(() => {
        const onResize = () => {
            const width = mapRef.current.offsetWidth;
            console.log(1);
            const width = mapRef.current.offsetWidth + 2;
            const height = window.innerHeight - 92;
            console.log(width, height);
            if (mapRef) {
@@ -32,10 +35,15 @@
        window.addEventListener('resize', onResize);
        onResize();
        return () => {
            app.destroy(true, true);
            window.removeEventListener('resize', onResize);
        }
        app.stage.interactive = true;
        app.stage.hitArea = app.screen;
        globalThis.__PIXI_APP__ = app;
        mapRef.current.appendChild(app.view);
        // return () => {
        //     app.destroy(true, true);
        //     window.removeEventListener('resize', onResize);
        // }
    }, []);
    return (