@dotsoftware/vue-google-maps-community-fork
Version:
Google Maps components for VueJS 3 maintained by the community
18 lines (15 loc) • 427 B
JavaScript
import { Env } from './utils/env'
import { createMapScript } from './utils/create-map-script'
let isApiSetUp = false
export function loadGMapApi(options) {
if (Env.isServer()) {
return
}
if (!isApiSetUp) {
isApiSetUp = true
const googleMapScript = createMapScript(options)
document.head.appendChild(googleMapScript)
} else {
throw new Error('You already started the loading of google maps')
}
}