Skip to content

Commit 19d47b6

Browse files
committed
removed dead component
1 parent 608e226 commit 19d47b6

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

components/Map/Map.jsx

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ const styles = (theme) => ({
100100
});
101101

102102
// Define feature layers
103-
const hoverables = ['nc-fills', 'cc-fills'];
104-
const featureLayers = ['request-circles', ...hoverables];
103+
const featureLayers = ['request-circles','nc-fills'];
105104

106105
class Map extends React.Component {
107106
// Note: 'this.context' is defined using the static contextType property
@@ -474,29 +473,27 @@ class Map extends React.Component {
474473
const features = this.getAllFeaturesAtPoint(e.point);
475474
for (let i = 0; i < features.length; i += 1) {
476475
const feature = features[i];
476+
if (feature.layer.id == "nc-fills") {
477+
this.setState({ address: null });
477478

478-
if (hoverables.includes(feature.layer.id)) {
479-
switch (feature.layer.id) {
480-
case 'nc-fills':
481-
this.setState({ address: null });
482-
this.resetAddressSearch(); // Clear address search input
483-
dispatchCloseBoundaries(); // Collapse boundaries section
484-
const selectedCouncilId = Number(feature.properties.NC_ID);
485-
const newSelectedCouncil = councils.find(
486-
({ councilId }) => councilId === selectedCouncilId
487-
);
488-
const newSelected = isEmpty(newSelectedCouncil)
489-
? null
490-
: [newSelectedCouncil];
491-
dispatchUpdateSelectedCouncils(newSelected);
492-
dispatchUpdateUnselectedCouncils(councils);
493-
dispatchUpdateNcId(selectedCouncilId);
494-
return this.ncLayer.selectRegion(feature.id);
495-
case 'cc-fills':
496-
return this.ccLayer.selectRegion(feature.id);
497-
default:
498-
return null;
499-
}
479+
this.resetAddressSearch(); // Clear address search input
480+
dispatchCloseBoundaries(); // Collapse boundaries section
481+
482+
const selectedCouncilId = Number(feature.properties.NC_ID);
483+
const newSelectedCouncil = councils.find(
484+
({ councilId }) => councilId === selectedCouncilId
485+
);
486+
const newSelected = isEmpty(newSelectedCouncil)
487+
? null
488+
: [newSelectedCouncil];
489+
490+
dispatchUpdateSelectedCouncils(newSelected);
491+
dispatchUpdateUnselectedCouncils(councils);
492+
dispatchUpdateNcId(selectedCouncilId);
493+
494+
return this.ncLayer.selectRegion(feature.id);
495+
} else{
496+
return null;
500497
}
501498
}
502499
};

0 commit comments

Comments
 (0)