Skip to content

Commit a5876ef

Browse files
Merge pull request #1073 from CodeForPhilly/revert-1064-donovan/property-zone-filtering
Revert "Filtering for only main zones"
2 parents 61c15b3 + a36ae02 commit a5876ef

File tree

2 files changed

+41
-36
lines changed

2 files changed

+41
-36
lines changed

src/components/Filters/filterOptions.ts

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -414,29 +414,39 @@ export const rcos: string[] = [
414414
];
415415

416416
export const zoning: string[] = [
417-
'CA',
418-
'CMX',
419-
'I',
417+
'CA-1',
418+
'CA-2',
419+
'CMX-1',
420+
'CMX-2',
421+
'CMX-2.5',
422+
'CMX-3',
423+
'CMX-4',
424+
'CMX-5',
425+
'I-1',
426+
'I-2',
427+
'I-3',
428+
'I-P',
420429
'ICMX',
421430
'IRMX',
422-
'RM',
423-
'RMX',
424-
'RSA',
425-
'RSD',
426-
'RTA',
427-
'SP',
431+
'RM-1',
432+
'RM-2',
433+
'RM-3',
434+
'RM-4',
435+
'RMX-1',
436+
'RMX-2',
437+
'RMX-3',
438+
'RSA-1',
439+
'RSA-2',
440+
'RSA-3',
441+
'RSA-4',
442+
'RSA-5',
443+
'RSA-6',
444+
'RSD-1',
445+
'RSD-2',
446+
'RSD-3',
447+
'RTA-1',
448+
'SP-AIR',
449+
'SP-INS',
450+
'SP-PO-A',
451+
'SP-STA',
428452
];
429-
430-
export const subZoning: Record<string, string[]> = {
431-
CA: ['CA-1', 'CA-2'],
432-
RSD: ['RSD-1', 'RSD-2', 'RSD-3'],
433-
RTA: ['RTA-1'],
434-
RM: ['RM-1', 'RM-2', 'RM-3', 'RM-4'],
435-
RMX: ['RMX-1', 'RMX-2', 'RMX-3'],
436-
CAX: ['CAX'],
437-
CMX: ['CMX-1', 'CMX-2', 'CMX-2.5', 'CMX-3', 'CMX-4', 'CMX-5'],
438-
IRMX: ['IRMX'],
439-
ICMX: ['ICMX'],
440-
I: ['I-1', 'I-2', 'I-3', 'I-P'],
441-
SP: ['SP-AIR', 'SP-INS', 'SP-PO-A', 'SP-STA'],
442-
};

src/components/PropertyMap.tsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
useStagingTiles,
1515
googleCloudBucketName,
1616
} from '../config/config';
17-
import { subZoning } from './Filters/filterOptions';
1817
import { useFilter } from '@/context/FilterContext';
1918
import Map, {
2019
Source,
@@ -349,18 +348,14 @@ const PropertyMap: FC<PropertyMapProps> = ({
349348
if (filterItem.values.length) {
350349
const thisFilterGroup: any = ['any'];
351350
filterItem.values.forEach((item) => {
352-
if (Object.keys(subZoning).includes(item)) {
353-
subZoning[item].forEach((subZone: string) => {
354-
if (filterItem) {
355-
thisFilterGroup.push([
356-
'>=',
357-
['index-of', subZone, ['get', property]],
358-
0,
359-
]);
360-
} else {
361-
thisFilterGroup.push(['in', ['get', property], subZone]);
362-
}
363-
});
351+
if (filterItem.useIndexOfFilter) {
352+
thisFilterGroup.push([
353+
'>=',
354+
['index-of', item, ['get', property]],
355+
0,
356+
]);
357+
} else {
358+
thisFilterGroup.push(['in', ['get', property], item]);
364359
}
365360
});
366361

0 commit comments

Comments
 (0)