@@ -39,11 +39,14 @@ export const Map: FC<{
39
39
const history = useHistory ( ) ;
40
40
41
41
const initialTreeCount = ( treesGeoJson as any ) . features . length
42
+ const initialPumpCount = ( waterSourcesGeoJson as any ) . features . filter (
43
+ ( feature ) => feature . properties ?. type === 'Handschwengelpumpe' ) . length ;
42
44
const initialWaterSourceCount = ( waterSourcesGeoJson as any ) . features . filter (
43
- ( feature ) => feature . properties ?. type !== 'LEIPZIG GIESST-Mobil' ) . length ;
45
+ ( feature ) => feature . properties ?. type !== 'LEIPZIG GIESST-Mobil' && feature . properties ?. type !== 'Handschwengelpumpe' ) . length ;
44
46
const initialMobileCount = ( waterSourcesGeoJson as any ) . features . filter (
45
47
( feature ) => feature . properties ?. type === 'LEIPZIG GIESST-Mobil' ) . length ;
46
48
const [ treeCount , setTreeCount ] = useState ( initialTreeCount ) ;
49
+ const [ pumpCount , setPumpCount ] = useState ( initialPumpCount ) ;
47
50
const [ waterSourceCount , setWaterSourceCount ] = useState ( initialWaterSourceCount ) ;
48
51
const [ mobileCount , setMobileCount ] = useState ( initialMobileCount ) ;
49
52
const [ zoom , setZoom ] = useState ( isMobile ? 13 : 11 ) ;
@@ -80,10 +83,12 @@ export const Map: FC<{
80
83
} else {
81
84
getTreeCount ( ) . then ( ( count ) => setTreeCount ( ( count as number ) ) ) ;
82
85
}
83
- getFeatureCount ( 'waterSources' , ( feature ) => feature ?. object ?. properties ?. type !== 'LEIPZIG GIESST-Mobil' ) . then ( ( count ) => setWaterSourceCount ( count as number ) ) ;
86
+ getFeatureCount ( 'waterSources' , ( feature ) => feature ?. object ?. properties ?. type === 'Handschwengelpumpe' ) . then ( ( count ) => setPumpCount ( count as number ) ) ;
87
+ getFeatureCount ( 'waterSources' , ( feature ) => feature ?. object ?. properties ?. type !== 'LEIPZIG GIESST-Mobil' && feature ?. object ?. properties ?. type !== 'Handschwengelpumpe' ) . then ( ( count ) => setWaterSourceCount ( count as number ) ) ;
84
88
getFeatureCount ( 'waterSources' , ( feature ) => feature ?. object ?. properties ?. type === 'LEIPZIG GIESST-Mobil' ) . then ( ( count ) => setMobileCount ( count as number ) ) ;
85
89
} else {
86
90
setTreeCount ( initialTreeCount ) ;
91
+ setPumpCount ( initialPumpCount ) ;
87
92
setWaterSourceCount ( initialWaterSourceCount ) ;
88
93
setMobileCount ( initialMobileCount ) ;
89
94
}
@@ -103,6 +108,7 @@ export const Map: FC<{
103
108
ref = { mapRef }
104
109
deckRef = { deckRef }
105
110
treeCount = { treeCount }
111
+ pumpCount = { pumpCount }
106
112
waterSourceCount = { waterSourceCount }
107
113
mobileCount = { mobileCount }
108
114
handleViewStateChanged = { onViewStateChanged }
0 commit comments