Skip to content

Commit

Permalink
Merge pull request CodeForPhilly#570 from CodeForPhilly/filter-fix-42124
Browse files Browse the repository at this point in the history
Filter fix 42124
  • Loading branch information
brandonfcohen1 authored Apr 22, 2024
2 parents c2fe0ee + ae686bd commit 3cebf75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 0 additions & 2 deletions data/src/data_utils/rco_geoms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import numpy as np

from classes.featurelayer import FeatureLayer
from constants.services import RCOS_LAYERS_TO_LOAD

Expand Down
20 changes: 10 additions & 10 deletions src/components/PropertyMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,21 +175,21 @@ const PropertyMap: FC<PropertyMapProps> = ({
const mapFilter = Object.entries(appFilter).reduce(
(acc, [property, filterItem]) => {
if (filterItem.values.length) {
if (filterItem.useIndexOfFilter) {
const useIndexOfFilterFilter: any = ["any"];
filterItem.values.map((item) => {
useIndexOfFilterFilter.push([
const thisFilterGroup: any = ["any"];
filterItem.values.forEach((item) => {
if (filterItem.useIndexOfFilter) {
thisFilterGroup.push([
">=",
["index-of", item, ["get", property]],
0,
]);
});
acc.push(useIndexOfFilterFilter);
} else {
acc.push(["in", property, ...filterItem.values]);
}
}
} else {
thisFilterGroup.push(["in", ["get", property], item]);
}
});

acc.push(thisFilterGroup);
}
return acc;
},
[] as any[]
Expand Down

0 comments on commit 3cebf75

Please sign in to comment.