谷歌地图Api v3灰色地图

时间:2013-09-26 20:30:20

标签: javascript google-maps google-maps-api-3 map google-maps-markers

所以我正在使用谷歌地图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);
}

1 个答案:

答案 0 :(得分:2)

mapOptions期待center - 属性(不是position