Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Stiofan

    (@stiofansisland)

    You will likely have to enable the autocomplete API for that Google account.
    In your API project click “Overview” and then “Enabled API’s” then search for Google Maps GeoCoding and enable, you might need the Directions one too.

    Thanks,

    Stiofan

    Thread Starter birima

    (@birima)

    Thanks for answering. I’ve checked but both api’s you mention are already enabled. I will have the plug-in developer let a look at it next week.

    Corrected plugin code.

    function rgmk_find_add_key( $url, $original_url, $_context ) {
    	$key = get_option( 'rgmk_google_map_api_key' );
    
    	// If no key added no point in checking
    	if ( ! $key ) {
    		return $url;
    	}
    
    	if ( strstr( $url, "maps.google.com/maps/api/js" ) !== false || strstr( $url, "maps.googleapis.com/maps/api/js" ) !== false ) {// it's a Google maps url
    
    		if ( strstr( $url, "key=" ) === false ) {// it needs a key
    			$url = add_query_arg( 'key',$key,$$original_url);
    			//$url = str_replace( "&", "&", $url ); // or $url = $original_url
    			$url = esc_url($url);
    		}
    
    	}
    
    	return $url;
    }
    • This reply was modified 8 years, 6 months ago by jancinert.
    • This reply was modified 8 years, 6 months ago by jancinert.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Map shows on page but autocomplete still not works’ is closed to new replies.