-
+
+
@@ -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/footer/leadership/left/left-center.js b/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js
index 36aeabe6..7587bf57 100644
--- a/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js
+++ b/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js
@@ -36,7 +36,7 @@ const Leftcenter = ({ videoCenterList }) => {
setNum(num + 1);
// setTu(list[num].img);
}
- }, 2000 * 10);
+ }, 1000 * 60 * 5);
return () => clearInterval(timer);
}, [num]);
diff --git a/web/client/src/sections/quanju/containers/public/olMap.js b/web/client/src/sections/quanju/containers/public/olMap.js
index 816ac777..85e7d53c 100644
--- a/web/client/src/sections/quanju/containers/public/olMap.js
+++ b/web/client/src/sections/quanju/containers/public/olMap.js
@@ -6,14 +6,20 @@ import moment from 'moment';
import { OlMapRequest } from '$utils'
const OlMap = (props) => {
- const { dispatch, actions, user, olMapArcgisHost, olMapGeoDataHost, patrolList, roadProjectList } = props
+ const { dispatch, actions, user, olMapArcgisHost, olMapGeoDataHost, patrolList, roadProjectList, tab } = props
const [olMapOpenData, setOlMapOpenData] = useState([])
const [olMap, setOlMap] = useState()
const [pointItem, setPointItem] = useState({})
useEffect(() => {
-
- }, [])
+ setOlMapOpenData([])
+ setPointItem({})
+ if (olMap) {
+ olMap.closeOverlay('clickOpen')
+ olMap.closeOverlay('pointClickOpen')
+ olMap.removeGeometryLayer('geometry0')
+ }
+ }, [tab])
useEffect(() => {
if (olMapGeoDataHost) {
@@ -148,7 +154,11 @@ const OlMap = (props) => {
}, [olMapGeoDataHost])
useEffect(() => {
- if (patrolList.length && olMap) {
+ if (patrolList.length && olMap && tab == 'conserve') {
+ roadProjectList.forEach((d, index) => {
+ olMap.removeGeometryLayer('geometry_road_' + index)
+ })
+
patrolList.forEach((d, index) => {
console.log(d, index);
olMap.addGeometryLayer({
@@ -164,7 +174,7 @@ const OlMap = (props) => {
setPointItem(d)
olMap.addOverlay('pointClickOpen', {
id: 'pointClickOpen',
- offset: [0, 25], // 偏移
+ offset: [0, 4], // 偏移
position: [d.longitude, d.latitude], // 坐标
autoPan: true,
autoPanMargin: 100,
@@ -178,9 +188,8 @@ const OlMap = (props) => {
],
style: {
icon: {
- src: '/assets/images/worker.png',
- // anchor: [0.5, 1],
- scale: 0.08, // 图标引用
+ src: '/assets/images/gis/pointer.png',
+ scale: 1, // 图标引用
},
// stroke: { width: 1, color: '#ffff00' },
// circle: {
@@ -191,9 +200,8 @@ const OlMap = (props) => {
},
selectStyle: {
icon: {
- src: '/assets/images/worker.png',
- // anchor: [0.5, 1],
- scale: 0.08, // 图标引用
+ src: '/assets/images/gis/pointer.png',
+ scale: 1, // 图标引用
},
// circle: {
// radius: 16, // 直径
@@ -206,10 +214,14 @@ const OlMap = (props) => {
});
});
}
- }, [patrolList, olMap])
+ }, [patrolList, olMap, tab])
useEffect(() => {
- if (roadProjectList.length && olMap) {
+ if (roadProjectList.length && olMap && tab == 'build') {
+ patrolList.forEach((d, index) => {
+ olMap.removeGeometryLayer('geometry_patrol_' + index)
+ })
+
roadProjectList.forEach((d, index) => {
olMap.addGeometryLayer({
features: [
@@ -224,7 +236,7 @@ const OlMap = (props) => {
setPointItem(d)
olMap.addOverlay('pointClickOpen', {
id: 'pointClickOpen',
- offset: [0, 25], // 偏移
+ offset: [0, 4], // 偏移
position: [d.longitude, d.latitude], // 坐标
// position: [115.944220000000, 28.545380000000],
autoPan: true,
@@ -240,21 +252,21 @@ const OlMap = (props) => {
],
style: {
icon: {
- src: '/assets/images/worker.png',
- scale: 0.08, // 图标引用
+ src: '/assets/images/gis/pointer.png',
+ scale: 1, // 图标引用
},
},
selectStyle: {
icon: {
- src: '/assets/images/worker.png',
- scale: 0.08, // 图标引用
+ src: '/assets/images/gis/pointer.png',
+ scale: 1, // 图标引用
},
},
layerName: 'geometry_road_' + index
});
});
}
- }, [roadProjectList, olMap])
+ }, [roadProjectList, olMap, tab])
const isRoadProject = pointItem.report_type == 'road'
return (
@@ -301,16 +313,23 @@ const OlMap = (props) => {
{
pointItem.id ?
-
+
: ''
}