Improve file naming

This commit is contained in:
Fawad Mirzad
2021-02-13 19:15:55 +01:00
parent 455a95912c
commit 402a03b842

18
src/load-google-maps.js Normal file
View File

@@ -0,0 +1,18 @@
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')
}
}