Commit 562a7b47 authored by 邹绪超's avatar 邹绪超

fix: 修复cesium加载失败

parent 06256ff9
......@@ -8101,7 +8101,6 @@
"version": "3.1.4",
"resolved": "https://g.civnet.cn:4873/array-includes/-/array-includes-3.1.4.tgz",
"integrity": "sha1-9bSTFix2DzU5Yx8AW6K7Rqy0W6k=",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"define-properties": "^1.1.3",
......@@ -10941,6 +10940,15 @@
"sha.js": "^2.4.8"
}
},
"create-react-context": {
"version": "0.3.0",
"resolved": "https://g.civnet.cn:4873/create-react-context/-/create-react-context-0.3.0.tgz",
"integrity": "sha512-dNldIoSuNSvlTJ7slIKC/ZFGKexBMBrrcc+TTe1NdmROnaASuLPvqpwj9v4XS4uXZ8+YPu0sNmShX2rXI5LNsw==",
"requires": {
"gud": "^1.0.0",
"warning": "^4.0.3"
}
},
"crequire": {
"version": "1.8.1",
"resolved": "https://g.civnet.cn:4873/crequire/-/crequire-1.8.1.tgz",
......@@ -14773,6 +14781,11 @@
"integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=",
"dev": true
},
"gud": {
"version": "1.0.0",
"resolved": "https://g.civnet.cn:4873/gud/-/gud-1.0.0.tgz",
"integrity": "sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw=="
},
"gzip-size": {
"version": "5.1.1",
"resolved": "https://g.civnet.cn:4873/gzip-size/-/gzip-size-5.1.1.tgz",
......@@ -18107,7 +18120,6 @@
"version": "2.4.1",
"resolved": "https://g.civnet.cn:4873/jsx-ast-utils/-/jsx-ast-utils-2.4.1.tgz",
"integrity": "sha512-z1xSldJ6imESSzOjd3NNkieVJKRlKYSOtMG8SFyCj2FIrvSaSuli/WjpBkEzCBoR9bYYYFgqJw61Xhu7Lcgk+w==",
"dev": true,
"requires": {
"array-includes": "^3.1.1",
"object.assign": "^4.1.0"
......@@ -24937,6 +24949,17 @@
"prop-types": "^15.6.2"
}
},
"react-activation": {
"version": "0.9.9",
"resolved": "https://g.civnet.cn:4873/react-activation/-/react-activation-0.9.9.tgz",
"integrity": "sha512-KeCbPGkWnRzYKxwaS3nEnsDIWLzrjKT5GfBb3WlzT1lunSVIeAhUP8vu6yoCgTv/GRYLpC+SGEmVGULyegKlaw==",
"requires": {
"create-react-context": "^0.3.0",
"hoist-non-react-statics": "^3.3.0",
"react-node-key": "^0.3.1",
"szfe-tools": "^0.0.0-beta.7"
}
},
"react-app-polyfill": {
"version": "0.2.2",
"resolved": "https://g.civnet.cn:4873/react-app-polyfill/-/react-app-polyfill-0.2.2.tgz",
......@@ -25152,6 +25175,15 @@
"resolved": "https://g.civnet.cn:4873/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
},
"react-node-key": {
"version": "0.3.1",
"resolved": "https://g.civnet.cn:4873/react-node-key/-/react-node-key-0.3.1.tgz",
"integrity": "sha512-PPMeZiDD5Od4cnEamiDZUifVgK7DKhan2NeYZPCmH5xsaeKDc+UrcQJK21CelLcyaMjPiQz1cxAR2hD4AB9I7g==",
"requires": {
"jsx-ast-utils": "^2.2.1",
"szfe-tools": "^0.0.0-beta.7"
}
},
"react-redux": {
"version": "7.0.2",
"resolved": "https://g.civnet.cn:4873/react-redux/-/react-redux-7.0.2.tgz",
......@@ -28963,6 +28995,14 @@
"integrity": "sha512-k8uzYIkIVwmT+TcglpdN50pS2y1BDcUnBPK9iJeGu0Pl1lOI8pD6wtzgw91Pjpe+RxtTncw32tLxs/R0yNL2Mg==",
"dev": true
},
"szfe-tools": {
"version": "0.0.0-beta.7",
"resolved": "https://g.civnet.cn:4873/szfe-tools/-/szfe-tools-0.0.0-beta.7.tgz",
"integrity": "sha1-WAusvD1ONTxqwAqzN7A3qlPRTpY=",
"requires": {
"@babel/runtime": "^7.10.2"
}
},
"table": {
"version": "5.4.6",
"resolved": "https://g.civnet.cn:4873/table/-/table-5.4.6.tgz",
......@@ -132,6 +132,7 @@
"qrcode.react": "^1.0.0",
"rc-cascader": "^2.3.2",
"react": "16.12.0",
"react-activation": "^0.9.9",
"react-dom": "16.12.0",
"react-draggable": "^4.4.3",
"react-helmet": "6.0.0-beta",
......
......@@ -36,6 +36,7 @@ import Panel from '@/components/SliderPanel/MinPanel';
import { actionCreators } from '@/containers/App/store';
// import CreateBaseMap from '@/pages/map';
import CesiumMap from '@/pages/cesiumMap'
import keepAlive, { KeepAlive } from 'react-activation'
// import Authorized from '@/utils/Authorized';
import {
findPathByLeafId,
......@@ -672,7 +673,7 @@ const BasicLayout = props => {
}
{
window.location.pathname.startsWith('/civbase/civ_3d') ? <CesiumMap /> : null
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null
}
<div id="micro-container" className="subapp-container">
{/*<CreateBaseMap/>*/}
......@@ -691,7 +692,7 @@ const BasicLayout = props => {
}
{
window.location.pathname.startsWith('/civbase/civ_3d') ? <CesiumMap /> : null
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null
}
<div id="micro-container" className="subapp-container">
{/*<CreateBaseMap/>*/}
......
......@@ -4,9 +4,11 @@ import { connect } from 'react-redux'
import { actionCreators } from '@/containers/App/store';
const cesiumMap = props => {
const ref = useRef(null)
const storeRef = useRef(null)
useEffect(() => {
const mapConfig3d = props.globalConfig?.mapConfig3d ?? {}
const mapConfig3d = props.globalConfig?.mapConfig3d
if (!(mapConfig3d && mapConfig3d?.baseMap?.length && mapConfig3d.web)) return
if(storeRef.current) return
const {widgets} = mapConfig3d
const schemes = parseScheme.parseSchemes(mapConfig3d)
const schemeData = parseScheme.parseDatas(schemes)
......@@ -16,8 +18,9 @@ const cesiumMap = props => {
delayWidgetRender : true,
...schemeData
})
storeRef.current = pdView
props.updatePdCesiumView(pdView)
}, [])
}, [props.globalConfig?.mapConfig3d ?? {}])
return (<div style={{
inset: 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment