Google maps api problem

Where I must put the API of google maps in visual composer ? I can not find where I must put it . thanks

1 Like

Hey @Borislav.VD,

There’s currently a known issue where the API key field is missing in X Google Map VC integration.

There’s no API setting in VC’s native Google Maps element also so regretfully, showing a Google Map isn’t currently possible using VC. You need to use Cornerstone and its Map element for this.

Thanks.

1 Like

I have a problem with cornerstone and I can not use it . I leave credentials thanks

Hello @Borislav.VD,

Thanks for asking. :slight_smile:

Looks like you are using a custom url to login into WordPress admin section. I tried following URL’s and both are pointing towards 404 page.

I scrolled previous replies in this ticket and seems you haven’t shared the admin URL. Can you please share the admin URL for us to take a closer look? Also please let us know the problem you are facing while using Cornerstone.

Thanks.

For sure I have attached them in the last message , thank you !

Hello @Borislav.VD,

Thanks for asking. :slight_smile:

I created a test post in Cornerstone and can confirm that it’s preview panel is not working properly, I checked the console and don’t see any error message as such. Further investigating I noticed that you are using two cache plugins WP Super Cache and Autoptimize. Well there is no issues in using both the plugins but sometimes they can cause conflicts. I also request you to please disable CSS and JS minification.

As it’s a customer website, I don’t have the authority to fiddle with the core functioning of the same without taking due permission. If above solutions don’t workout then please try testing for plugin conflict by deactivating all plugins. If you see Cornerstone working the we can be sure that it’s conflicting plugin that’s causing the problem. After that you need to reactivate one at a time to narrow down.

Regarding maps, you can use Cornerstone Maps element and under setup enter the API in API Key text box. https://cl.ly/1G3t0T3R0t13

However, in order to use Maps element we first need to get Cornerstone working. Please let us know the output of above solutions.

Thanks.

ok i have seen this topic , is still that works?

function my_add_frontend_scripts() {
wp_register_script( ā€˜vendor-google-maps’, ā€˜https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY’);
wp_enqueue_script( ā€˜vendor-google-maps’ );
}
add_action(ā€˜wp_enqueue_scripts’, ā€˜my_add_frontend_scripts’, 100);

Hi There,

We’ve already tested that code. It will not work.

Right now, you can try using the iframe emebed code instead.

Regards!

OK and if I put the api code in the uber menu?

Hello @Borislav.VD,

Thanks for updating the thread. :slight_smile:

Do you plan to display maps location in menu? I suggest you to please take a look at following article.

As per your request, I have moved the URL’s into secure note. That way information is in between you and Themeco staff.

Thanks.

No , but i have read that if there is 1 google maps api into the website it would be enough in order to activate all of the google maps into it . If the cornerstone has a problem , the functions.php alternative is not working , I must find how could put a google api into the mine website somehow . Any ideas ( without using additional plugins ) ?

Hi,

Yes, it only needs to be added once.

Can you try disabling google map api ni your ubermenu then add the code below in your child theme’s functions.php file

function my_add_frontend_scripts() {
wp_register_script( 'vendor-google-maps', 'https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY');
wp_enqueue_script( 'vendor-google-maps' );
}
add_action('wp_enqueue_scripts', 'my_add_frontend_scripts', 100);

Don’t forget to change YOUR_API_KEY with your key

Thanks

Morning ! Your colleague have told me that this code would not work . Who is right ? Thanks

ĀØ
Hi There,

We’ve already tested that code. It will not work.

Right now, you can try using the iframe emebed code instead.

Regards!

ĀØ

Hey @Borislav.VD,

I just pasted the code in my test site and it works. Not sure why it does not work on @thai’s end.

I also rechecked your page with Google Maps and see that it’s working now. Looks like this is resolved?

Thanks.

Hi everyone,

on my side, no needs to add any js code in my child-theme function.php.
In the Google API Key field in Cornerstone, I just found a ā€œspaceā€ at the beginning and at the end of my API code.
Everything works fine once I removed it.

Try it and let know if it works!

Thanks for sharing, @Design-Solutia.

Hello,
With the risk of cluttering I can confirm that Google Map Api Key Field is not shown on Visual Composer (VC latest version 5.4.7 and Theme Pro 2.0.4).

The duplicate js is throwing errors:

Tried to unregister the script, no luck…

Please make a checkbox (it should be possible) that read : ā€œLoad Google Maps Java ?ā€ Like this we cand put our key functions.php in child theme as registered script. Or other plugins (where someone can chose his API key) can do what CornerStone shortcode can’t. Is one of the most used shortcodes in CS… and it’s a little broken.

Update:
Creating the Google Map Shortcode with Cornerstone (With Visual Composer deactivated).
Creating the API Key and adding that to the CS field.
Saving the page and then when looking at it :
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.

So the problem is not VisualComposer, is the Cornerstone that load twice the ā€œhttps://maps.googleapis.com/maps/api/jsā€ , perhaps one in google_map.php and second time in partials.
Please assure us that those shortcodes are tested before release.

Hi,

I tried this in my test sites and can’t seem to replicate the issue.

There could be another plugin that is causing the issue.

You could try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

If that doesn’t help, kindly create a new topic and provide us your login credentials in Secure Note

Thanks

Thank you for yout answer.
I will debug the charging order with https://fr.wordpress.org/plugins/query-monitor/ and come back with findings since the bug with Visual Composer not showing the API field is known, maybe I will find the culprit and tell you.

Thanks.