我正在尝试在我的网站上使用Google地图。我用这个代码
<script type="text/javascript"
src="https://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
所以在FF中它会抛出一个错误c [Db]不是一个函数 ...... Db](d); c.e = new Ff; c.Yb = new Mf; c.mapTypes = new Sf; c.features = new Af; var e = c.Zb = new ... 如何调试此错误或修复? }
答案 0 :(得分:0)
您在创建地图时省略了new-operator,它必须是:
var map = new google.maps.Map(document.getElementById(id+'-canvas'), myOptions);
//________^