import { useState as u, useEffect as l } from "react";
import { useMapContext as d } from "../../MapContext.js";
import { useUpdateProp as r, useUpdateEventListenerMap as f } from "../../../utils/hooks.js";
const v = (c) => {
  const { position: i, radius: n = 100, precision: o = 60, style: p, eventListenerMap: a } = c, { api: s } = d(), [e, m] = u();
  return l(() => {
    const t = new H.map.Circle(i, n, { style: p, precision: o });
    return m(t), s.map?.addObject(t), () => {
      s.map?.getObjects().includes(t) && s.map?.removeObject(t), t.dispose();
    };
  }, [s.map]), r(e, "setCenter", i), r(e, "setStyle", p), r(e, "setRadius", n), r(e, "setPrecision", o), f(e, a), null;
};
export {
  v as default
};
//# sourceMappingURL=Circle.js.map
