import MapContext from "../Map/MapContext.mjs";
import { c } from "react-compiler-runtime";
import { useContext, useEffect } from "react";
import { Zoom } from "ol/control";
//#region src/map-library/Controls/ZoomControl.js
const ZoomControl = (props) => {
	const $ = c(4);
	const { map } = useContext(MapContext);
	let t0;
	let t1;
	if ($[0] !== map || $[1] !== props) {
		t0 = () => {
			if (!map) return;
			const zoomControl = new Zoom(props);
			map.controls.push(zoomControl);
			return () => map.controls.remove(zoomControl);
		};
		t1 = [map, props];
		$[0] = map;
		$[1] = props;
		$[2] = t0;
		$[3] = t1;
	} else {
		t0 = $[2];
		t1 = $[3];
	}
	useEffect(t0, t1);
	return null;
};
//#endregion
export { ZoomControl };

//# sourceMappingURL=ZoomControl.mjs.map