如何制作简单的标记biostall CodeIgniter-Google-Maps-V3-API-Library

时间:2016-08-18 04:30:03

标签: php codeigniter google-maps google-maps-api-3

我的控制器文件:

$this->load->library('googlemaps');

$config['center'] = '37.4419, -122.1419';
$config['zoom'] = 'auto';
$this->googlemaps->initialize($config);

$marker = array();
$marker['position'] = '37.429, -122.1419';
$this->googlemaps->add_marker($marker);
$data['map'] = $this->googlemaps->create_map();

$this->load->view('view_file', $data);

我的观看文件:

<html>
<head><?php echo $map['js']; ?></head>
<body><?php echo $map['html']; ?></body>
</html>

我的文件夹库项目中有CodeIgniter-Google-Maps-V3-API-Library。

我的源文件:https://github.com/BIOSTALL/CodeIgniter-Google-Maps-V3-API-Library

结果如下: enter image description here

我问谷歌,但她建议我在https://developers.google.com/maps/documentation/javascript/get-api-key

中制作API_KEY

现在,我有api密钥,但如何安装呢?

1 个答案:

答案 0 :(得分:0)

在你的图书馆打开你的googlemaps.php,

找到这个变量

var $apiKey='';

并填入您的API密钥,例如

var $apiKey='your API key';