Codeigniter谷歌地图api
我刚刚测试了GoogleMapsAPI到codeigniter,但出现了一个我不理解的错误。 严重性:通知 消息:未定义变量:map 代码来自这里Codeigniter谷歌地图api,codeigniter,maps,Codeigniter,Maps,我刚刚测试了GoogleMapsAPI到codeigniter,但出现了一个我不理解的错误。 严重性:通知 消息:未定义变量:map 代码来自这里 您确定要加载“谷歌地图”库吗?类地图扩展了CI_控制器{function index(){$this->load->library('googlemaps');$config['center']='35.825795,10.607212';$config['zoom']='auto';$config['directions']=TRUE;$confi
您确定要加载“谷歌地图”库吗?类地图扩展了CI_控制器{function index(){$this->load->library('googlemaps');$config['center']='35.825795,10.607212';$config['zoom']='auto';$config['directions']=TRUE;$config['directionstart']='Sousse Railway';$config['directionsEnd']='Sousse Sud';$config['directionsDivID']='directionsDiv';$this->googlemaps->initialize($config);$data['map']=$this->googlemaps->create_map();$this->load->view('maps',$data);}
if (isset($_GET["w1"]) && isset($_GET["w2"]))
{
$config['center'] = $lat = $_GET["w1"].','.$lng = $_GET["w2"];
$marker = array();
$marker['position'] = $lat = $_GET["w1"].','.$lng = $_GET["w2"];
$latlng = $_GET["w1"].','.$_GET["w2"];
$request = file_get_contents('https://maps.googleapis.com/maps/api/geocode/json?address=.$latlng.&key=AIzaSyAOAR94QMB9YdE8RXHG-8NE28cz6wdUw2I');
$json = json_decode($request, true);
$marker['infowindow_content'] = implode("|", $json);
$this->googlemaps->add_marker($marker);
}