【问题标题】:how to make simple marker biostall CodeIgniter-Google-Maps-V3-API-Library如何制作简单的标记 biostall CodeIgniter-Google-Maps-V3-API-Library
【发布时间】:2016-12-24 21:39:41
【问题描述】:

我的控制器文件:

$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

结果如下:

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

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

【问题讨论】:

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


    【解决方案1】:

    在您的图书馆中打开您的 googlemaps.php,

    找到这个变量

    var $apiKey='';
    

    并用您的 API 密钥填充它,例如

    var $apiKey='your API key';
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-18
      • 2017-02-17
      • 1970-01-01
      相关资源
      最近更新 更多