|
|
@ -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) { |
|
|
|
tab == 'home' && map && renderMarkers() |
|
|
|
tab == 'device' && map && renderDevices() |
|
|
|
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,31 +304,16 @@ function Map(props) { |
|
|
|
} |
|
|
|
|
|
|
|
const renderLeftTop = () => { |
|
|
|
return tab == 'person' ? |
|
|
|
<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='home_total_number'>45<span style={{ fontSize: 12 }}>万</span></div> |
|
|
|
return <div className='home_left'> |
|
|
|
<div className='hometotalbg'>廉租房总数</div> |
|
|
|
<div className='home_total_number'>455 <span style={{ fontSize: 12 }}>万</span></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'>45<span style={{ fontSize: 12 }}>万</span></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> |
|
|
|
<div className='cztotal'>空置</div> |
|
|
|
<div className='home_total_number'>45<span style={{ fontSize: 12 }}>万</span></div> |
|
|
|
</div> |
|
|
|
} |
|
|
|
|
|
|
|
const renderRightBottom = () => { |
|
|
|