Commit 59ef6087 authored by 邓超's avatar 邓超

fix: 修改三维地图根据参数名称是否加载

parent 3da27a8b
Pipeline #72142 failed with stages
......@@ -411,6 +411,28 @@ const Layout = props => {
props.global.userInfo.site = '';
}
}
const getParams = pathname => {
let ret = {};
let url = pathname ? pathname : decodeURIComponent(window.location.pathname);
if (url.indexOf('|') > -1) {
let params = url.split('|')[1];
params.split('&').map(function(item) {
return (ret[item.split('=')[0]] = item.split('=')[1]);
});
return ret;
}
return ret;
};
const isHaveMap = () => {
const params = getParams();
if (params.loadMap === 'true') {
return true;
} else {
return false;
}
};
return (
<SecurityLayout {...props}>
<BasicLayout
......@@ -478,7 +500,7 @@ const Layout = props => {
{/* <ArcgisMap options={{ type: 'ArcgisMap' }} /> */}
{/* ) */}
{/* ) : null} */}
{window.location.pathname.startsWith('/civbase/civ_3d/map') ? (
{window.location.pathname.startsWith('/civbase/civ_3d/map') || isHaveMap() ? (
<KeepAlive>
<CesiumMap />
</KeepAlive>
......
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