useOlOverlayComponent
useOlOverlayComponent():
Overlay
Defined in: src/ol-overlay-component.tsx:105
Hook to access the OpenLayers Overlay instance from the nearest parent OlOverlay component. Must be used within a descendant of OlOverlay.
Returns
Section titled “Returns”Overlay
The OpenLayers Overlay instance
Throws
Section titled “Throws”If called outside of an OlOverlay component
Example
Section titled “Example”function OverlayContent() { const overlay = useOlOverlayComponent() // Use overlay instance return <div>Content</div>}