Tenho Esta programaçao:
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of gMaps
*
* @author Only Informatica
*/
class gMaps {
//put your code here
// Host do GoogleMaps
private $mapsHost = 'maps.google.com';
// Sua Google Maps API Key
public $mapsKey = '';
function __construct($key = null) {
if (!is_null($key)) {
$this->mapsKey = $key;
}
}
function carregaUrl($url) {
if (function_exists('curl_init')) {
$cURL = curl_init($url);
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, true);
$resultado = curl_exec($cURL);
curl_close($cURL);
} else {
$resultado = file_get_contents($url);
}
if (!$resultado) {
return false;
//trigger_error('Não foi possível carregar o endereço: <strong>' . $url . '</strong>');
} else {
return $resultado;
}
}
function geoLocal($endereco) {
$url = 'http://'. $this->mapsHost .'/maps/geo?output=csv&key='. $this->mapsKey .'&q='. urlencode($endereco);
$dados = $this->carregaUrl($url);
list($status, $zoom, $latitude, $longitude) = explode(',', $dados);
if ($status != 200) {
return false;
//trigger_error('Não foi possível carregar o endereço <strong>"'.$endereco.'"</strong>, código de resposta: ' . $status);
}
return array('lat' => $latitude, 'lon' => $longitude, 'zoom' => $zoom, 'endereco' => $endereco);
}
}
?>
E ao entrar no site dame este erro : Este website precisa de uma chave diferente para a API do Google Maps. Uma nova chave pode ser gerada em
http://code.google.com/apis/maps/documentation/javascript/v2/introduction.html#Obtaining_Key.
E depois ao entrar na página da localização, surge este:
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /home/site/public_html/classes/gMaps.class.php on line 30
Alguem me podera ajudar ?