Warning in console when using the Map element

Hello,

When i use the map element with my Google API key, the map is working fine but i have a warning in chrome console :

“Google Maps JavaScript API has been loaded directly without loading=async. This can result in suboptimal performance.”

It that something to be concerned about ?
Should pro add the loading=async attribute when it’s generating the map ?

Thanks.

Hi, I’ve been seeing the same warning for a while now. I’m not an expert, so I can’t tell you if it might affect performance or other issues, but at least in my projects, I haven’t noticed any anomalies beyond this warning.

However, if you want it to stop appearing, there’s an easy solution by adding the following code (line 97) in the file /themes/pro/cornerstone/includes/elements/definitions/map.php if you use Pro, or in /plugins/cornerstone/includes/elements/definitions/map.php if you use X.

fix-maps

Although, if you’re not familiar with the code, I’d recommend not touching it in case an error occurs on your website and you don’t know how to fix it. Also, once Theme.co releases a new version, the file will be overwritten, and the warning will reappear unless they add the fix in the new version.

Cheers!

1 Like

Hi @popoche and Guillermo,

I have checked with Charlie on this, and this will be added in one of the upcoming releases.

Thanks

1 Like

Great ! Thanks :grinning:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.