所以我正在使用谷歌地图api v3.13,我得到一张灰色地图。它也没有任何控制。我的自定义标记未显示。我一无所获。我没有收到任何错误,所以我不太清楚会发生什么。
<div id="map-canvas"></div>
#map-canvas {
width: 530px;
height: 298px;
}
.mapbox {
width: 240px;
height: 120px;
padding: 15px;
font-family: @sansFontFamily;
color: @white;
background-color: @lcOrange;
a {
display: block;
color: @white;
}
}
var gmap;
function initialize() {
var myLat = new google.maps.LatLng(33.991447,-84.09403);
var mapOptions = {
zoom: 13,
position: myLat,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var gmap = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
var mapIcon = '../fw/img/map-marker-lowres.png';
var contentString = '<div class="mapbox">' + '<p><strong>The Arena at Gwinnett Center</strong></p>' + '<p>6400 Sugarloaf Pkwy<br>Duluth, GA 30097<br>(770) 813-7500</p>' + '<p>6400 Sugarloaf Pkwy<br>Duluth, GA 30097<br>(770) 813-7500</p>' + '<a href="">> get driving directions</a></div>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var marker = new google.maps.Marker({
position: myLat,
icon: mapIcon,
map: gmap
});
infowindow.open(gmap,marker);
marker.setMap(gmap);
}
答案 0 :(得分:2)
mapOptions
期待center
- 属性(不是position
)