Result list when typing an adress

New home Forums Basic Version General queries Result list when typing an adress

This topic contains 8 replies, has 2 voices, and was last updated by  Dylan 2 years, 9 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #24725

    Nina1983
    Member

    Hello,

    In the basic version when creating a new marker, in the adress line when I type an adress no results are shown – normally you know in google you begin to type an address and it shows you already some partial results / suggestions. I find this very comfortable. Is this supposed to work the same way here? Or maybe in the PRO version works different?

    Thanks in advance,

    #24743

    Dylan
    Moderator

    Hi there,

    Thank you so much for your time on this one.

    Both the Basic and Pro versions of WP Google Maps includes autocomplete (address suggestions) and should work as intended. It is however possible that your API key has run out of autocomplete daily requests.

    Could I ask you to confirm that you have created an API key for your map?

    It is also possible that this is due to a bug within our basic code. I am currently debugging this and will be able to shed more light as soon as I have looked into this in more detail.

    #24756

    Nina1983
    Member

    Dear Dylan,

    I tried both with an existing credential and a new one. I can confirm I have the Google Places API Service activated (i saw that this is the one responsible for the Auto-complete). When I use another plugin I have installed with Google Maps ( I always keep only one Google Maps plugin active at the same time) the autocomplete works and I can see the requests in the Google API Dashboard.

    Thanks,

    #24798

    Dylan
    Moderator

    Hi again,

    Thank you so much for your time on this one, I really appreciate it.

    After debugging this further I found that this is due to our latest release not including the ‘places’ library from the Google Maps API. This library is responsible for the auto-complete, and we believe this occurred when we changed the way the API was being loaded.

    We will have this resolved in the next release of the Basic, however in the meantime I would like to offer to guide you through some simple steps to rectify this.

    Are you comfortable with making minor code changes?

    Note: Our pro add-on features the auto-complete functionality, which works as intended as well.

    #24818

    Nina1983
    Member

    Hey, I could make code changes. Let me know what needs to be changed! Thanks!

    #24826

    Dylan
    Moderator

    Hi Nina,

    Not a problem at all, happy to help!

    In order to apply the code changes you will need to find and edit the wpGoogleMaps.php file (wp-content/plugins/wp-google-maps/wpGoogleMaps.php), and look for the following segment of code:

    if( $wpgmza_api_key ){
       wp_enqueue_script('wpgmza_api_call', '//maps.google'.$wpgmza_suffix.'/maps/api/js?'.$api_version_string.'key='.$wpgmza_api_key.'&language='.$wpgmza_locale, array(), null );            
    } else {
       /* use temp API key */
       $wpgmza_temp_api_key = get_option('wpgmza_temp_api');
       wp_enqueue_script('wpgmza_api_call', '//maps.google'.$wpgmza_suffix.'/maps/api/js?'.$api_version_string.'key='+$wpgmza_temp_api_key+'&language='.$wpgmza_locale, array(), null );            
    }
    

    This would need to be changed to the following:

    if( $wpgmza_api_key ){
       wp_enqueue_script('wpgmza_api_call', '//maps.google'.$wpgmza_suffix.'/maps/api/js?'.$api_version_string.'key='.$wpgmza_api_key.'&language='.$wpgmza_locale.'&libraries=places', array(), null );            
    } else {
       /* use temp API key */
       $wpgmza_temp_api_key = get_option('wpgmza_temp_api');
       wp_enqueue_script('wpgmza_api_call', '//maps.google'.$wpgmza_suffix.'/maps/api/js?'.$api_version_string.'key='+$wpgmza_temp_api_key+'&language='.$wpgmza_locale'&libraries=places', array(), null );            
    }
    

    Please note there will be more than one instance of the code above.

    I hope this helps? I am also more than happy to handle this on your behalf?

    #24861

    Nina1983
    Member

    Hi Dylan,
    I added the parameter and it worked, thanks a lot! 🙂

    #24862

    Nina1983
    Member
    This reply has been marked as private.
    #24872

    Dylan
    Moderator
    This reply has been marked as private.
Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.