Skip to content

Commit

Permalink
Fix quarters url
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoriiPrudnikov authored and gcor committed Nov 19, 2023
1 parent e8eca76 commit 9e53a63
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 98 deletions.
4 changes: 2 additions & 2 deletions components/Layers/Quarter/quarter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import quarterObjects from 'public/quarter_inspectors.json';
import { QuarterObject } from './quarterObject';

export const quarter = {
getObject(quarterTitle: string): Promise<QuarterObject> {
getObject(quarterId: string): Promise<QuarterObject> {
return Promise.resolve(
quarterObjects.features.find((f) => f.properties.quarterTitle === decodeURI(quarterTitle)).properties as unknown as QuarterObject,
quarterObjects.features.find((f) => f.properties.id === quarterId).properties as unknown as QuarterObject,
);
},
};
2 changes: 1 addition & 1 deletion components/Map/layers/QuarterSource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function QuarterSource() {
const handlePointClick = (e) => {
const item = e.target.queryRenderedFeatures(e.point)[0];

openPopup(decodeURI(item?.properties?.quarterTitle), MapItemType.Quarter);
openPopup(item?.properties?.id, MapItemType.Quarter);
};

map.on('click', QUARTER_LAYER_ID, handlePointClick);
Expand Down
Loading

0 comments on commit 9e53a63

Please sign in to comment.