import MapContext from "../Map/MapContext.mjs";
import { c } from "react-compiler-runtime";
import { useContext, useEffect } from "react";
import { FullScreen } from "ol/control";
//#region src/maps/openLayerMaps/Controls/FullScreenControl.js
const FullScreenControl = () => {
	const $ = c(3);
	const { map } = useContext(MapContext);
	let t0;
	let t1;
	if ($[0] !== map) {
		t0 = () => {
			if (!map) return;
			const fullScreenControl = new FullScreen({});
			map.controls.push(fullScreenControl);
			return () => map.controls.remove(fullScreenControl);
		};
		t1 = [map];
		$[0] = map;
		$[1] = t0;
		$[2] = t1;
	} else {
		t0 = $[1];
		t1 = $[2];
	}
	useEffect(t0, t1);
	return null;
};
//#endregion
export { FullScreenControl as default };

//# sourceMappingURL=FullScreenControl.mjs.map