<script setup>
import { watch } from "vue";
import { useGoogleMapsResource } from "./useGoogleMapsResource";
const props = defineProps({
  options: { type: Object, required: false }
});
const heatmapLayer = useGoogleMapsResource({
  async create({ mapsApi, map }) {
    await mapsApi.importLibrary("visualization");
    return new mapsApi.visualization.HeatmapLayer({
      map,
      ...props.options
    });
  },
  cleanup(layer) {
    layer.setMap(null);
  }
});
watch(() => props.options, (options) => {
  if (heatmapLayer.value && options) {
    heatmapLayer.value.setOptions(options);
  }
}, { deep: true });
</script>

<template>

</template>
