diff --git a/src/components/layers/SourcesLayer.tsx b/src/components/layers/SourcesLayer.tsx index 996c8cd..fad6071 100644 --- a/src/components/layers/SourcesLayer.tsx +++ b/src/components/layers/SourcesLayer.tsx @@ -1,5 +1,4 @@ import { useRef, useState, useEffect, useCallback } from 'react'; -import { Source } from '../../types/maps'; import { Feature, Map, Overlay } from 'ol'; import VectorLayer from 'ol/layer/Vector'; import VectorSource from 'ol/source/Vector'; @@ -8,7 +7,11 @@ import { Circle } from 'ol/geom'; import Select, { SelectEvent } from 'ol/interaction/Select.js'; import { click } from 'ol/events/condition'; import { MapProps } from '../OpenLayersMap'; -import { transformCoords, transformSources } from '../../utils/layerUtils'; +import { + createSourcePopupContent, + transformCoords, + transformSources, +} from '../../utils/layerUtils'; type SourcesLayerProps = { sourceLists: MapProps['sourceLists']; @@ -24,9 +27,9 @@ export function SourcesLayer({ flipped, }: SourcesLayerProps) { const popupRef = useRef(null); - const [selectedSourceData, setSelectedSourceData] = useState< - Source | undefined - >(undefined); + const [selectedSourceId, setSelectedSourceId] = useState( + undefined + ); const sourceGroupRef = useRef(null); const selectInteractionRef = useRef