【发布时间】:2014-01-18 02:57:41
【问题描述】:
我实际上为我的网站集成了谷歌地图,但地图没有显示,我使用图书馆谷歌地图但仍然没有显示。 这是我的代码:
控制器:
<?php
class api extends CI_Controller
{
public function index()
{
parent::Controller();
}
function googleapi()
{
$this->load->library('googlemaps');
$config = array();
$config['zoom'] = 'auto';
$config['geocodeCaching'] = TRUE;
$config['region'] = 'US';
$config['sensor'] = FALSE;
$this->googlemaps->create($config);
$markers = array();
$marker['position'] = '37.429, -122.1519';
$marker['animation'] = 'DROP';
$this->googlemaps->add_markers($markers);
$markers = array();
$marker['position'] = '1600 Amphitheatre Parkway in Mountain View, Santa Clara County, California United States';
$marker['animation'] = 'DROP';
$this->googlemaps->add_markers($markers);
$data['map'] = $this->googlemaps->create();
echo print_r($data['map']['markers']);
}
}
?>
如果我的代码有问题,请帮助我。谢谢
【问题讨论】:
标签: javascript php codeigniter google-maps-api-3