在使用codeigniter的谷歌地图中没有定义ReferenceError: auto



嗨,我在CodeIgniter中有这个GoogleMaps库,我已经测试了它,看看地图是否会在我的视图页面中呈现。发生的事情是,当我看到我的视图页面,我得到了这一行错误。

ReferenceError: auto is not defined
map.setCenter(new GLatLng(37.4419, -122.1419), auto);

在我看来,我使用这行代码

<?php echo $map['javascript']; ?>

为javascript渲染map中的代码,这行代码也

<?php echo $map['mapdiv']; ?>
有谁能帮我弄清楚这行错误吗?
ReferenceError: auto is not defined

map.setCenter(new GLatLng(37.4419, -122.1419), auto);

它说referenceError auto没有定义。非常感谢任何帮助。TIA。

autoundefined时,它没有在某个地方定义,这就是它的情况(如果没有看到库,就不可能说更多)。

但是你最好不要使用这个库,因为它似乎使用了APIV2,而APIV2已经被弃用很多年了,已经被关闭了。

但是,要修复这个错误,可以使用下面这行:

map.setCenter(new google.maps.LatLng(37.4419, -122.1419));

最新更新