diff --git a/super-screen/client/assets/images/homepage/communtity/kztotal.png b/super-screen/client/assets/images/homepage/communtity/kztotal.png new file mode 100644 index 0000000..d7a0b3e Binary files /dev/null and b/super-screen/client/assets/images/homepage/communtity/kztotal.png differ diff --git a/super-screen/client/src/sections/community-safty/containers/gis.js b/super-screen/client/src/sections/community-safty/containers/gis.js index 9591251..fff92a0 100644 --- a/super-screen/client/src/sections/community-safty/containers/gis.js +++ b/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) { - 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' ? -