Tagged: 

Viewing 30 posts - 1 through 30 (of 34 total)
  • Author
    Posts
  • #835906

    I had implemented the fix that was recommended in another post to address embedded Google Maps not displaying/showing an error by placing the code below in the functions.php file, but it is no longer working. It had been displaying fine until recently. If someone could help with this, it would be great.

    function ava_googlemaps_apikey() {
    	$prefix  = is_ssl() ? "https" : "http";
        wp_deregister_script('avia-google-maps-api');
    	wp_register_script( 'avia-google-maps-api', $prefix.'://maps.google.com/maps/api/js?key=AIzaSyAidX34J-pkIHmOUFdVrt05MpzDHz-VZUk', array('jquery'), '3', true);
    	wp_enqueue_script('avia-google-maps-api');
    }
    add_action('init', 'ava_googlemaps_apikey');
    #836367

    Hey NicomIT,

    Please send us a temporary admin login and login URL so that we can have a closer look. You can post the details in the Private Content section of your reply.

    Best regards,
    Rikard

    #836402

    Sure. The info is below.

    Also, I notice the same thing is happening on one of our client’s websites. I included two links to that as well.

    #836789

    Hi,

    Thanks for the details, though the login URL only redirects me to the front page. On what page can we log in?

    Best regards,
    Rikard

    #836969

    Hi Rikard,
    That should have worked, but I disabled some of the additional features in the security tool we are using when you login. So maybe that was the issue. You can also try logging in using the link below.

    #837324

    Hi,

    Sorry but I’m still getting redirected, I tried using VPN with a dutch IP as well but the same thing happens. I’m not sure why?

    Best regards,
    Rikard

    #837443

    Hi Rikard,
    I had another look at the security tool (I’m using iThemes Security Pro) and I think I might know what the issue is. I had “Away Mode” enabled for hours I wouldn’t need to login to the website. So with the time difference you might have been trying to login when that was set to not allow access to the the WP dashboard. I disabled that, so hopefully you can login now.

    #837503

    Hi,

    I checked the site. You have to link Enfold to a valid Google Maps API key.

    Goto Dashboard -> Enfold -> Google Services and enter a valid API key.

    Hope, this will help to solve the problem.

    Best regards,
    Günter

    #838783

    Thanks Günter. I created a key and added it. So far the map is still not loading though. Is there anything else I need to do? Or just keep checking/refreshing the page until the key is recognized?

    #838834

    Hi NicomIT,

    Here is the error that you’re getting:
    https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error

    Best regards,
    Victoria

    #838941

    Thanks Victoria. I added the domain to the referrer settings, but it’s still not working. I think the issue is on Google’s end and I’m likely leaving something out, but I have no idea what it is. The instructions for this from Google are not very clear.

    #839328

    So I’ve followed the instructions from Google as best as I can understand them and added the new API key in the theme options as instructed here. But the map still isn’t working. I have included links to two screenshots below. The first one is the page via Google where I created the key and the second is an error I get when I edit the existing map and click on the “Fetch Coordinates” button. The error says, “The key is probably either restricted to the wrong domain or the domain syntax you entered is wrong.” However, the domain I entered is correct and is for the website the map is set-up on. I’m not sure what to do now and can’t tell if I’m missing a step, or if there is an issue with the theme that is causing this. Any help would be great.

    #839416

    Hi NicomIT,

    Try using wildcards like *.nicominteractive.com/*
    Is this key used only for this website?

    Best regards,
    Victoria

    #839519

    Hi Victoria,
    I added *.nicominteractive.com/* and still no luck. This key was created only for this website and for the issue with the map.

    #840453

    Hi, I was just wondering if there was anything else I can try? It looks like I am following all the instructions correctly, but the map still isn’t loading.

    #841035

    Hi,

    Create a new key please, so we can be sure that the cache is fixed and that the URL is like what Victoria suggested.
    Also make sure that you give it sometime to be crawled and do let us know if that would fix the issues.

    Best regards,
    Basilis

    #842004

    Hi Basilis,
    I regenerated the key again and still can’t get the map to display. When I click the “Check API Key” button under the theme options > “Google Services” it says the key is valid. But when I try to add the map to the contact page, I get this message when I click the button to fetch the coordinates for the address:

    An error occurred
    It seems that your Google API key is not configured correctly
    The key is probably either restricted to the wrong domain or the domain syntax you entered is wrong.
    Please check your API key here
    The domain that should be allowed is:
    http://www.nicominteractive.com/*

    Under the key I am using now I have “HTTP referrers (web sites)” selected under the key restriction area and http://www.nicominteractive.com/* added under “Accept requests”.

    As near as I can tell, I’m following all the steps correctly. But still no luck.

    #843238

    Hi,

    Oh – I just noticed and I am sorry for that.
    The web site needs to be on https: so it can work properly.
    You need a SSL certificate.

    Best regards,
    Basilis

    #843664

    Hi Basilis,
    I was able to figure out the issue. There was a fix related to embedding Google maps provided by your support a while ago when Google started requesting an API key to be used. The code and key below was provided by Kriesi to add to the ‘functions.php’ file. I think now that I added my own API in the theme options, it was conflicting with the API in the ‘functions.php’ file. I removed the code and API key below from the file and now the map works. From what I can see there isn’t a need for an SSL certificate.

    function ava_googlemaps_apikey() {
    	$prefix  = is_ssl() ? "https" : "http";
        wp_deregister_script('avia-google-maps-api');
    	wp_register_script( 'avia-google-maps-api', $prefix.'://maps.google.com/maps/api/js?key=AIzaSyAidX34J-pkIHmOUFdVrt05MpzDHz-VZUk', array('jquery'), '3', true);
    	wp_enqueue_script('avia-google-maps-api');
    }
    add_action('init', 'ava_googlemaps_apikey');
    #844987

    After my last post I tried to make the same fix on the other website (linked below) where I was seeing the same issue. I deleted the code mentioned above from the ‘functions.php’ file and regenerated an API key exactly as I did for the website where the map is working, but no luck. Am I the only person who has been experiencing this problem? I’m pretty sure I am doing everything correctly. I’d really appreciate any help you can provide to help resolve this. Thanks.

    #845178

    Hi,

    Yes, you have to remove the previous code in the functions.php file. Regarding the other site, we can see the following error.

    Google Maps API error: DeletedApiProjectMapError https://developers.google.com/maps/documentation/javascript/error-messages#deleted-api-project-map-error

    Did you delete the API project? Please re-create it, add the site as one of the http referrers then insert this code in the functions.php file.

    function set_custom_google_maps_source( array $api_src ) {
         $api_src['version'] = '3.30';	 
         return $api_src;
    }
    add_filter( 'avf_google_maps_source', 'set_custom_google_maps_source', 10, 1 );

    Best regards,
    Ismael

    #845362

    Thanks Ismael. Yes, I removed that code from the ‘functions.php’ file in both websites. I added the code you just provided to the second website (http://www.brunelloestates.com/) and recreated the key, however the map still isn’t working. I provided a screenshot below of how the key is configured, which is the same as what I did for the first website. So I’m not sure what the problem is.

    The only thing I can think of is the website used another plugin (https://codecanyon.net/item/google-maps-plus-for-visual-composer/13510102) that embeds a Google map. Maybe there is some conflict. But I disabled the plugin and it didn’t help.

    #845559

    Hey!

    I’m sorry about that. The filter does not exist yet in the current version. For now, please edit the config-templatebuilder > avia-shortcodes > google_maps.php file, look for this code around line 37.

    $api_url = $prefix.'://maps.google.com/maps/api/js?v=3.27';
    

    Set the version from 3.27 to 3.30. In the next update, we’ll include the filter so that you don’t have to edit this file.

    Cheers!
    Ismael

    #845784

    Thanks Ismael. I updated the version number in that file and unfortunately the maps still aren’t working. When I put in the API code in the theme options and click the “Check API Key” button, I get the “Could not connect to Google Maps with this API Key” message. As I mentioned before and as you can see in the screenshot, I’m pretty sure I have the key set-up correctly. I also tried removing the code provided in your previous post in the ‘functions.php’ file, but that didn’t help, so I put it back in.

    #846708

    Hi,

    Please remove the code in the functions.php file because it will conflict with the theme’s API key option. I tried to login to the site but the previous login credentials are not working anymore.

    Best regards,
    Ismael

    #848168

    Hi Ismael,
    I removed this code from the “functions.php” file:

    function set_custom_google_maps_source( array $api_src ) {
         $api_src['version'] = '3.30';	 
         return $api_src;
    }
    add_filter( 'avf_google_maps_source', 'set_custom_google_maps_source', 10, 1 );

    And the “config-templatebuilder > avia-shortcodes > google_maps.php” file has the updated version number you provided on this line of code:
    $api_url = $prefix.'://maps.google.com/maps/api/js?v=3.30';
    The maps still aren’t displaying. So I’m not sure what else I can try. I’m sure I have done everything correctly.
    The login info I provided a couple of weeks ago was for a separate website that was having the same issue. See the private info for this post for a login to this website.

    • This reply was modified 6 years, 7 months ago by NicomIT.
    #848926

    Hi,

    I checked the Google Services panel and I got the following error.

    js?v=3.27&key=AIzaSyDhPffnlVat4C-7NIk8l3EZxMFfJaYO3yE:35 Google Maps API error: DeletedApiProjectMapError https://developers.google.com/maps/documentation/javascript/error-messages#deleted-api-project-map-error
    _.rb @ js?v=3.27&key=AIzaSyDhPffnlVat4C-7NIk8l3EZxMFfJaYO3yE:35
    js?v=3.27&callback=av_backend_maps_loaded&key=AIzaSyDhPffnlVat4C-7NIk8l3EZxMFfJaYO3yE:38 Google Maps API error: DeletedApiProjectMapError https://developers.google.com/maps/documentation/javascript/error-messages#deleted-api-project-map-error

    It means that the map API has been deleted. Are you sure that you’re using the correct API key? Please re-create the API project and get a new API key.

    // http://kriesi.at/documentation/enfold/how-to-register-a-google-maps-api-key/

    The “Retired Version” notification is not critical so the map should work even if it is using the old script.

    Best regards,
    Ismael

    #849109

    Hi Ismael,
    The key I had been using should be correct and still active. So I don’t know why the error said it had been deleted. I created a new project and API key and the map still doesn’t work. I have no idea what I’m doing or not doing, but I would love to get this resolved.

    #849473

    Hi,

    It’s still producing the same error. Please post the gmail account and the security questions. We’ll inspect it.

    Best regards,
    Ismael

    #849578

    See the private data.

    • This reply was modified 6 years, 7 months ago by NicomIT.
Viewing 30 posts - 1 through 30 (of 34 total)
  • The topic ‘Google Map Not Displaying After Making Recomended Fix’ is closed to new replies.