我正在尝试使用Google Maps API。我直接复制从文档the example code但地图显示不出来我预想的方式:Google地图不显示
我想看看通过我的代码,看看是否有任何错误,但没有运气。任何想法?
http://jsfiddle.net/DerekL/B3KYB/(关键是去除)
function initialize() {
var mapOptions = {
zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644),
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map($("#mapView")[0], mapOptions);
}
尝试'的document.getElementById( 'MapView的')',而不是使用jQuery。 – RobH
@RobH - 我不是真的在我的代码中返回一个jQuery对象。但我曾尝试将其改为本机方法,但问题仍然存在。 –