如何从我的 DIV 中获取谷歌地图对象?
这是我为设置地图所做的:
var map = new google.maps.Map(document.getElementById("map_canvas"),
mapOptions);
然后我想让地图做到这一点:
var marker = new google.maps.Marker({
position: initialLocation,
map: document.getElementById("map_canvas"),
title:"AJAX!"
});
当然,这会产生错误。
未捕获的错误:属性值无效:[object HTMLDivElement]