如何将谷歌地图 API 放在 codeigniter 中?

Bel*_*ion 1 php google-maps codeigniter

我的图书馆来自

http://biostall.com/codeigniter-google-maps-v3-api-library

并按照说明进行操作

http://biostall.com/demos/google-maps-v3-api-codeigniter-library/

但我收到一条错误信息

遇到 PHP 错误

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Googlemaps has a deprecated constructor

Filename: libraries/Googlemaps.php

Line Number: 16

Backtrace:

File: C:\xampp\htdocs\test_map\application\controllers\Welcome.php
Line: 25
Function: library

File: C:\xampp\htdocs\test_map\index.php
Line: 292
Function: require_once
Run Code Online (Sandbox Code Playgroud)

有谁知道如何解决这个问题?

Tpo*_*jka 5

尝试重命名

function Googlemaps($config = array())
{
    if (count($config) > 0)
    {
        $this->initialize($config);
    }
    log_message('debug', "Google Maps Class Initialized");
}
Run Code Online (Sandbox Code Playgroud)

function __construct($config = array())
{
    if (count($config) > 0)
    {
        $this->initialize($config);
    }
    log_message('debug', "Google Maps Class Initialized");
}
Run Code Online (Sandbox Code Playgroud)

如果不起作用,那么库可能需要更多的代码更改,因为它的代码超过 2-3 年。