From 84720d77037f6d3c8b06c0653281ace615ad1fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98lijianhao=E2=80=99?= Date: Wed, 27 Jul 2022 11:52:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E6=9A=82=E6=97=B6=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/quanju/containers/example.js | 73 +++++++++---------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/web/client/src/sections/quanju/containers/example.js b/web/client/src/sections/quanju/containers/example.js index 1facdfec..bfb78d30 100644 --- a/web/client/src/sections/quanju/containers/example.js +++ b/web/client/src/sections/quanju/containers/example.js @@ -24,46 +24,46 @@ const Example = (props) => { } - useEffect(() => { - const timer = setTimeout(() => { - const map = new AMap.Map(MAPID, { - //resizeEnable: true, - center: [115.912663, 28.543149],//地图中心点,初始定位加载显示楼块 - // center: [115.857952, 28.683003],//地图中心点 - zoom: 13,//地图显示的缩放级别 - zooms: [8, 18], - pitch: 65, // 地图俯仰角度,有效范围 0 度- 83 度 - viewMode: '3D', // 地图模式 - // rotation: 60 - // showLabel: false - }); - let styleName = 'amap://styles/fb26776387242721c2fc32e2cb1daccc'; - map.setMapStyle(styleName); + // useEffect(() => { + // const timer = setTimeout(() => { + // const map = new AMap.Map(MAPID, { + // //resizeEnable: true, + // center: [115.912663, 28.543149],//地图中心点,初始定位加载显示楼块 + // // center: [115.857952, 28.683003],//地图中心点 + // zoom: 13,//地图显示的缩放级别 + // zooms: [8, 18], + // pitch: 65, // 地图俯仰角度,有效范围 0 度- 83 度 + // viewMode: '3D', // 地图模式 + // // rotation: 60 + // // showLabel: false + // }); + // let styleName = 'amap://styles/fb26776387242721c2fc32e2cb1daccc'; + // map.setMapStyle(styleName); - let mapComplete = false; - let windowOnload = false; - window.onload = function () { - windowOnload = true; - } + // let mapComplete = false; + // let windowOnload = false; + // window.onload = function () { + // windowOnload = true; + // } - }, 50); + // }, 50); - //主题样式 + // //主题样式 - return () => { - const amapKeys = Object.keys(localStorage).filter(key => key.match(/^_AMap_/)) // 销毁地图 - amapKeys.forEach(key => { - localStorage.removeItem(key) - }) - map.clearMap(); - if (map) map.destroy(); - clearTimeout(timer) - } - }, []) + // return () => { + // const amapKeys = Object.keys(localStorage).filter(key => key.match(/^_AMap_/)) // 销毁地图 + // amapKeys.forEach(key => { + // localStorage.removeItem(key) + // }) + // map.clearMap(); + // if (map) map.destroy(); + // clearTimeout(timer) + // } + // }, []) return ( @@ -74,20 +74,13 @@ const Example = (props) => { document.body.clientHeight / 1080 )})`, */ }}> -
+ {/*
*/}
- {/* <<<<<<< HEAD */}
*/}