我正在嘗試使用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對象。但我曾嘗試將其改爲本機方法,但問題仍然存在。 –