import { useContext, useEffect } from 'react';
import { Zoom } from 'ol/control';
import MapContext from '../Map/MapContext';
export const ZoomControl = (props) => {
    const { map } = useContext(MapContext);
    useEffect(() => {
        if (!map)
            return;
        const zoomControl = new Zoom(props);
        map.controls.push(zoomControl);
        return () => map.controls.remove(zoomControl);
    }, [map, props]);
    return null;
};
//# sourceMappingURL=ZoomControl.js.map