Browse Source

(*)社区gis完善

master
peng.peng 1 year ago
parent
commit
1243c5c2aa
  1. BIN
      super-screen/client/assets/images/homepage/communtity/kztotal.png
  2. 34
      super-screen/client/src/sections/community-safty/containers/gis.js
  3. 6
      super-screen/client/src/sections/community-safty/containers/gis.less

BIN
super-screen/client/assets/images/homepage/communtity/kztotal.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

34
super-screen/client/src/sections/community-safty/containers/gis.js

@ -51,10 +51,7 @@ function Map(props) {
map.on('complete', () => {
setDelay(false)
// setTimeout(() => {
// tab == 'home' && map && renderMarkers()
// tab == 'device' && map && renderDevices()
// }, 1000);
tab == 'home' && map && renderMarkers()
});
map.on('click', (e) => {
@ -82,10 +79,12 @@ function Map(props) {
useEffect(() => {
if (!delay) {
setTimeout(() => {
tab == 'home' && map && renderMarkers()
tab == 'device' && map && renderDevices()
}, 200);
}
}, [tab]);
}, [tab, devices]);
useEffect(() => {
if (!delay) map && renderDevices()
@ -126,7 +125,7 @@ function Map(props) {
var marker = new AMap.Marker({
position: new AMap.LngLat(x.lng, x.lat),
// 将一张图片的地址设置为 icon
icon: '/assets/images/homepage/communtity/' + x.kind + '.png',
icon: '/assets/images/homepage/communtity/markerblue.png',
// 设置了 icon 以后,设置 icon 的偏移量,以 icon 的 [center bottom] 为原点
offset: new AMap.Pixel(-13, -30),
zooms: [3, 14],
@ -305,30 +304,15 @@ function Map(props) {
}
const renderLeftTop = () => {
return tab == 'person' ?
<div className='home_left'>
<div className='hometotalbg'>区域总人数</div>
return <div className='home_left'>
<div className='hometotalbg'>廉租房总数</div>
<div className='home_total_number'>455 <span style={{ fontSize: 12 }}></span></div>
<div className='hqtotal'>新生儿总数</div>
<div className='hqtotal'>租赁中</div>
<div className='home_total_number'>45<span style={{ fontSize: 12 }}></span></div>
<div className='cztotal'>老人总数</div>
<div className='cztotal'>空置</div>
<div className='home_total_number'>45<span style={{ fontSize: 12 }}></span></div>
</div> :
<div className='home_left'>
<div className='hometotalbg'>租赁房屋总数</div>
<div className='home_total_number'>4556</div>
<div className='hqtotal'>回迁房总数</div>
<div className='home_total_number'>4556</div>
<div className='cztotal'>城中村总数</div>
<div className='home_total_number'>4556</div>
<div className='lztotal'>廉租房</div>
<div className='home_total_number'>4556</div>
</div>
}

6
super-screen/client/src/sections/community-safty/containers/gis.less

@ -350,7 +350,7 @@
.hqtotal {
width: 126.45px;
height: 26.23px;
padding-left: 24px;
padding-left: 30px;
background: url('/assets/images/homepage/communtity/hqtotal.png') no-repeat;
background-size: 100% 100%;
}
@ -358,8 +358,8 @@
.cztotal {
width: 126.45px;
height: 26.23px;
padding-left: 24px;
background: url('/assets/images/homepage/communtity/cztotal.png') no-repeat;
padding-left: 38px;
background: url('/assets/images/homepage/communtity/kztotal.png') no-repeat;
background-size: 100% 100%;
}

Loading…
Cancel
Save