Created
September 27, 2023 14:50
-
-
Save transcendr/b3ff52f62014f9743c07715a13e904c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.envService.load().pipe( | |
first(env => env.googleApiKey != null), | |
map((env) => { | |
const currentLang = 'fr'; //this.languageService.getLanguage(); | |
const currentRegion = 'FR'; //this.languageService.getRegion(); | |
const googleApiKey = env.googleApiKey; // 'AIzaSyBU3fyx7thOvVj4K53uNR3N-c9cOUR_62g'; | |
// const src = `https://maps.googleapis.com/maps/api/js?key=${googleApiKey}&libraries=visualization,places&geometry®ion=${currentRegion}&language=${currentLang}`; | |
const script = document.createElement('script'); | |
script.src = `https://maps.googleapis.com/maps/api/js?key=${googleApiKey}&callback=initMap`; | |
script.type = 'text/javascript'; | |
script.id = 'gmap'; | |
script.async = true; | |
document.body.appendChild(script); | |
}) | |
).subscribe(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment