| | |
| | | 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(); |
| | |
| | | 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) { |
| | |
| | | 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 ( |