useOlSelectEventListener
useOlSelectEventListener(
select,type,listener):Select|null
Defined in: src/use-ol-select-event-listener.tsx:36
Hook to attach an event listener to an OpenLayers Select interaction. Automatically handles cleanup when the component unmounts or dependencies change.
Parameters
Section titled “Parameters”select
Section titled “select”The OpenLayers Select interaction instance (null-safe)
Select | null
The type of select event to listen for (e.g., ‘select’)
listener
Section titled “listener”The callback function to execute when the event fires
Returns
Section titled “Returns”Select | null
The Select interaction instance
Example
Section titled “Example”const select = useOlLayerSelect()useOlSelectEventListener(select, 'select', (evt) => { console.log('Selected features', evt.selected)})