我使用包含 Google maps API V3 库的 codeigniter。一切都加载到构造函数等...
我的控制器内容来自...
$config['icon'] = "http://localhost/xampp/zadanie_/myimg.png";
$config['center'] = $data['lat'].",".$data['lon'];
$config['map_height'] = 180;
$config['sensor'] = false;
$config['map_width'] = 198;
$config['disableMapTypeControl'] = TRUE;
$config['disableStreetViewControl'] = TRUE;
$config['zoom'] = '10';
$this->googlemaps->initialize($config);
$marker = array();
$marker['position'] = $data['lat'].",".$data['lon'];
$this->googlemaps->add_marker($marker);
之后,加载页面...生成的 Javascript 包含以下代码:
function initialize() {
var myLatlng = new google.maps.LatLng(48.1405,17.0948);
var myOptions = {
zoom: 10,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false,
streetViewControl: false}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var myLatlng = new google.maps.LatLng(48.1405,17.0948);
var markerOptions = {
map: map,
position: myLatlng
};
marker_0 = createMarker(markerOptions);
}
没有图标项。我在做什么坏事?:(