import L from 'leaflet'
import { Ref, onMounted, ref } from 'vue'

function useMap(mapContainer: Ref<string | HTMLElement>, options: L.MapOptions) {
    const map = ref<L.Map>();

    onMounted(() => {
        map.value = L.map(mapContainer.value, options)
    })

    return [map]
}

export default useMap