The Static Maps API uses an API key to identify your application.
API keys are managed through the Google APIs console. To activate the Static Maps API and create your key:
1. Visit the APIs console at https://code.google.com/apis/console and log in with your Google Account.
2. Click the Services link from the left-hand menu, then activate the Static Maps API service.
3. Once the service has been activated, your API key is available from the API Access page, in the Simple API Access section.
4. Static Maps API applications use the Key for browser apps.
5. Enter generated key on your Modules » Google Maps » Google Maps Settings page
REMEMBER: Google has changed API2 (deprecated) to API3.
To fix this issue with retrieving address coordinates manually do following (fixed in v2.2.0 or higher):
1. Open include/classes/DoctorAddresses.class.php, find there UpdateCoordinates() class
2. API code with following:
Code: Select all
$address = urlencode($address);
$url = 'http://maps.google.com/maps/api/geocode/json?address='.$address.'&sensor=false';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXYPORT, 3128);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
$response_a = json_decode($response);
$latitude = $response_a->results->geometry->location->lat;
$longitude = $response_a->results->geometry->location->lng;