I have a typescript page in my Angular application that calls Google maps Timezone.
I don't think it's a good idea, or it doesn't seem like a good idea to store either the url or the key as a hardcoded string. Both of which I'm doing now.
What's the prescribed way to store these two values (url, key)?
In the environment file?
Fetch it from the server every time I want to use it?
Some other file in the Angular project?
Here is the way I construct it. It's all hard coded in the .ts file.
const url = 'https://maps.googleapis.com/maps/api/timezone/json?location=' + this.latitude.value + ',' + this.longitude.value + '×tamp=' + Math.floor(Date.now() / 1000).toString() + '&key=' + 'my-google-key';
const timeZoneResult = await fetch(url, {
method: 'GET'
});
const timeZone = await timeZoneResult.json();