From 7e5706e8b4cda0d60b066995809f051f5f8db866 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 19 Jul 2023 23:39:24 +0800 Subject: [PATCH] =?UTF-8?q?gis=E5=BC=B9=E6=A1=86=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../footer/leadership/centerleft/hudong.js | 30 +++++++++++++------ .../quanju/containers/public/olMap.js | 12 ++++++-- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/hudong.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/hudong.js index 41ec44a9..4d01525f 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/hudong.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/hudong.js @@ -2,7 +2,7 @@ import { values } from 'lodash'; import React, { Component } from 'react'; import './conter.less'; class ReactCarousel extends Component { - chunk(arr, size) { + chunk (arr, size) { var arr1 = new Array(); for (var i = 0; i < Math.ceil(arr.length / size); i++) { arr1[i] = new Array(); @@ -45,7 +45,7 @@ class ReactCarousel extends Component { // arr1: "" dizhi: localStorage.getItem("qndmn") } - // console.log(this.state.imgs); + console.log(this.props.shuzu); this.state.imgs = this.props.shuzu.filter((item) => { return item.imgs !== "" }) @@ -53,7 +53,7 @@ class ReactCarousel extends Component { } - render() { + render () { return (
{ this.start() }} //鼠标退出自动播放 > -
    +
      { this.state.imgs.map((value, index) => { return ( -
    • -
      - +
      +
    • @@ -101,11 +113,11 @@ class ReactCarousel extends Component {
) } - componentDidMount() { //一开始自动播放 + componentDidMount () { //一开始自动播放 this.start(); } - componentWillUnmount() { //销毁前清除定时器 + componentWillUnmount () { //销毁前清除定时器 this.stop(); } stop = () => { //暂停 diff --git a/web/client/src/sections/quanju/containers/public/olMap.js b/web/client/src/sections/quanju/containers/public/olMap.js index 28c0af62..85e7d53c 100644 --- a/web/client/src/sections/quanju/containers/public/olMap.js +++ b/web/client/src/sections/quanju/containers/public/olMap.js @@ -12,7 +12,13 @@ const OlMap = (props) => { const [pointItem, setPointItem] = useState({}) useEffect(() => { - + setOlMapOpenData([]) + setPointItem({}) + if (olMap) { + olMap.closeOverlay('clickOpen') + olMap.closeOverlay('pointClickOpen') + olMap.removeGeometryLayer('geometry0') + } }, [tab]) useEffect(() => { @@ -256,7 +262,7 @@ const OlMap = (props) => { scale: 1, // 图标引用 }, }, - layerName: 'geometry_road_'// + index + layerName: 'geometry_road_' + index }); }); } @@ -307,7 +313,7 @@ const OlMap = (props) => {
{ pointItem.id ? -