Browse Source

地图暂时注释

release_0.0.4
‘lijianhao’ 3 years ago
parent
commit
84720d7703
  1. 89
      web/client/src/sections/quanju/containers/example.js

89
web/client/src/sections/quanju/containers/example.js

@ -24,46 +24,46 @@ const Example = (props) => {
} }
useEffect(() => { // useEffect(() => {
const timer = setTimeout(() => { // const timer = setTimeout(() => {
const map = new AMap.Map(MAPID, { // const map = new AMap.Map(MAPID, {
//resizeEnable: true, // //resizeEnable: true,
center: [115.912663, 28.543149],//地图中心点,初始定位加载显示楼块 // center: [115.912663, 28.543149],//地图中心点,初始定位加载显示楼块
// center: [115.857952, 28.683003],//地图中心点 // // center: [115.857952, 28.683003],//地图中心点
zoom: 13,//地图显示的缩放级别 // zoom: 13,//地图显示的缩放级别
zooms: [8, 18], // zooms: [8, 18],
pitch: 65, // 地图俯仰角度,有效范围 0 度- 83 度 // pitch: 65, // 地图俯仰角度,有效范围 0 度- 83 度
viewMode: '3D', // 地图模式 // viewMode: '3D', // 地图模式
// rotation: 60 // // rotation: 60
// showLabel: false // // showLabel: false
}); // });
let styleName = 'amap://styles/fb26776387242721c2fc32e2cb1daccc'; // let styleName = 'amap://styles/fb26776387242721c2fc32e2cb1daccc';
map.setMapStyle(styleName); // map.setMapStyle(styleName);
let mapComplete = false; // let mapComplete = false;
let windowOnload = false; // let windowOnload = false;
window.onload = function () { // window.onload = function () {
windowOnload = true; // windowOnload = true;
} // }
}, 50); // }, 50);
//主题样式 // //主题样式
return () => { // return () => {
const amapKeys = Object.keys(localStorage).filter(key => key.match(/^_AMap_/)) // 销毁地图 // const amapKeys = Object.keys(localStorage).filter(key => key.match(/^_AMap_/)) // 销毁地图
amapKeys.forEach(key => { // amapKeys.forEach(key => {
localStorage.removeItem(key) // localStorage.removeItem(key)
}) // })
map.clearMap(); // map.clearMap();
if (map) map.destroy(); // if (map) map.destroy();
clearTimeout(timer) // clearTimeout(timer)
} // }
}, []) // }, [])
return ( return (
@ -74,20 +74,13 @@ const Example = (props) => {
document.body.clientHeight / 1080 document.body.clientHeight / 1080
)})`, */ )})`, */
}}> }}>
<div id={MAPID} style={{ position: 'absolute', width: "100%", height: "100%" }}></div> {/* <div id={MAPID} style={{ position: 'absolute', width: "100%", height: "100%" }}></div> */}
<div style={{ width: "100%", height: "10%" }}> <div style={{ width: "100%", height: "10%" }}>
<Header tabChange={tabChange} tabKey={tabKey} dispatch={dispatch} /> <Header tabChange={tabChange} tabKey={tabKey} dispatch={dispatch} />
</div> </div>
{/* <<<<<<< HEAD */}
<div style={{ width: "100%", height: "90%" }}> <div style={{ width: "100%", height: "90%" }}>
<Footer tabKey={tabKey} dispatch={dispatch} /> <Footer tabKey={tabKey} dispatch={dispatch} />
{/* =======
<div style={{ position: 'absolute', width: "100%", height: "90%" }}>
<Footer tabKey={tabKey} />
>>>>>>> 385f017aeac33adc39a31e75faf6254a1a881d16 */}
</div> </div>
{/* </div> */}
</div> </div>
</Spin> </Spin>

Loading…
Cancel
Save