diff --git a/client/src/components/map/MapComponent.tsx b/client/src/components/map/MapComponent.tsx index 1d40248..f0bb98f 100644 --- a/client/src/components/map/MapComponent.tsx +++ b/client/src/components/map/MapComponent.tsx @@ -35,6 +35,7 @@ import { Style } from 'ol/style' import MapRegionSelect from './MapRegionSelect/MapRegionSelect' import MapLayersSelect from './MapLayers/MapLayersSelect' import MapObjectSearch from './MapObjectSearch/MapObjectSearch' +import { useCapitals } from '../../hooks/map/useCapitals' const swrOptions: SWRConfiguration = { revalidateOnFocus: false @@ -468,6 +469,7 @@ const MapComponent = ({ } }, [selectedRegion, selectedDistrict, id]) + useCapitals(capitalsLayer, !!selectedDistrict) useEffect(() => { if (selectedYear) { @@ -476,6 +478,7 @@ const MapComponent = ({ } }, [selectedYear]) + return (