代码存在一些问题,而且没有通过此库获取地理位置
$这 - >负载>库( 'Google地图');
$config = array();
$config['center'] = 'auto';
$config['onboundschanged'] = 'if (!centreGot) {
var mapCentre = map.getCenter();
marker_0.setOptions({
position: new google.maps.LatLng(mapCentre.lat(), mapCentre.lng())
});
}
centreGot = true;';
$this->googlemaps->initialize($config);
// set up the marker ready for positioning
// once we know the users location
$marker = array();
$this->googlemaps->add_marker($marker);
$data['map'] = $this->googlemaps->create_map();