Skip to content

fix(filters): Toggle visibility on cluster layers when updating source - #191

Merged
arnaudfnr merged 4 commits into
mainfrom
david-bretaud-dev/fix-link-filter-with-clustering-layers
Jul 18, 2026
Merged

fix(filters): Toggle visibility on cluster layers when updating source#191
arnaudfnr merged 4 commits into
mainfrom
david-bretaud-dev/fix-link-filter-with-clustering-layers

Conversation

@david-bretaud-dev

@david-bretaud-dev david-bretaud-dev commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Issue: #190

Coordo ts : dataforgoodfr/Coordonnees#98

See demo in coordo ts PR

Will need a coordo update in the package.json

@david-bretaud-dev david-bretaud-dev self-assigned this Jul 12, 2026
@david-bretaud-dev
david-bretaud-dev force-pushed the david-bretaud-dev/fix-link-filter-with-clustering-layers branch from e40eb1b to db11e96 Compare July 12, 2026 16:05
}: {
layerId: string;
isActive: boolean;
showLayer?: (layerId: string) => void;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are showLayer and hideLayer optional ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because when initializing the map, in the mapContainerRef callback, in handleReady, we have to cope with the TS of the mapApiRef.current that can be undefined, thus the provided props are optional

      // On first mount, sync the map state with the local storage state of "categories-filters"
      syncInitialCategoriesFilters({
        hideLayer: mapApiRef.current?.hideLayer,
        showLayer: mapApiRef.current?.showLayer,
      });

Comment thread webapp/src/features/categories-filters/use-categories-filters.ts Outdated
@david-bretaud-dev
david-bretaud-dev force-pushed the david-bretaud-dev/fix-link-filter-with-clustering-layers branch from db11e96 to e0f3462 Compare July 18, 2026 16:44
@arnaudfnr
arnaudfnr merged commit 65c2765 into main Jul 18, 2026
5 checks passed
@arnaudfnr
arnaudfnr deleted the david-bretaud-dev/fix-link-filter-with-clustering-layers branch July 18, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants