import { isNil, isString } from "lodash-es";
import { useMap } from "react-map-gl/maplibre";
import { useAttachImageFromIcon } from "./use-attach-image-from-icon.js";
import { attachImageFromString } from "../functions/attach-image-from-string.js";
const useAttachSymbolToMap = (icon, suffix = "", outputSize) => {
  const { current: map } = useMap();
  const customIconAttached = useAttachImageFromIcon(icon, suffix, outputSize);
  if (isNil(map)) {
    return null;
  }
  if (!customIconAttached && isString(icon)) {
    attachImageFromString(map, icon, suffix, outputSize);
  }
};
export {
  useAttachSymbolToMap
};
//# sourceMappingURL=use-attach-symbol-to-map.js.map
