Google Map Api quota limit

ontarget

Active Member
Hi I have a calc field element which is using Google maps to calculate distance from one point to another.
This was working fine until today...

PHP:
$data = file_get_contents("http://maps.googleapis.com/maps/api/distancematrix/json?origins=$from&destinations=$to1|$to2&language=en-EN&sensor=false");
  $data = json_decode($data);
  print_r ($data );
  $distance1 = 0;
  $distance2 = 0;
 
  $distance1 = $data->rows[0]->elements[0]->distance->value;
  $distance2 = $data->rows[0]->elements[1]->distance->value;
  $code =  '{course_registrants___course_code}';
  $pieces = explode ( "-" , $code );
  //echo    $pieces[1];
  return round($distance1/1000)." ".round($distance2/1000);
  //return $from;
  //return ($pieces[1] == "HO") ? 0 : min(round($distance1/1000), round($distance2/1000));
}

Here is the error

stdClass Object ( [destination_addresses] => Array ( ) [error_message] => You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/apis/credentials?project=_ [origin_addresses] => Array ( ) [rows] => Array ( ) [status] => OVER_QUERY_LIMIT ) 0 0

I verified the domain with Google and have obtained a couple of api keys - any idea where they can be added to allow the verification?
 
For Fabrik's built in maps stuff, you just set the Google API key in our global options.

In your custom code, I think you'd need to add &key=xxxxxxxxxx to your URL.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top