useOlMap
useOlMap():
Map
Defined in: src/ol-map.tsx:81
Hook to access the OpenLayers Map instance from the nearest parent OlMap component. Must be used within a descendant of OlMap.
Returns
Section titled “Returns”Map
The OpenLayers Map instance
Throws
Section titled “Throws”If called outside of an OlMap component
Example
Section titled “Example”function MapControl() { const map = useOlMap() // Use map instance return <div>Map ready</div>}