I'm trying to use Google MAP API v3 with the following code.(我正在尝试使用以下代码使用Google MAP API v3。)
<h2>Topology</h2>
<script src="https://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="{% url css_media 'tooltip.topology.css' %}" />
<link rel="stylesheet" type="text/css" href="{% url css_media 'tooltip.css' %}" />
<style type="text/css" >
#map_canvas {
width:300px;
height:300px;
}
</style>
<script type="text/javascript">
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);
</script>
<div id="map_canvas"> </div>
When I run this code, the browser says this.(当我运行此代码时,浏览器会这样说。)
Uncaught TypeError: Cannot read property 'offsetWidth' of null(未捕获的TypeError:无法读取null的属性'offsetWidth')
I have no idea, since I follow the direction given in this tutorial .(我不知道,因为我遵循本教程中给出的指示。)
Do you have any clue?(你有什么线索吗?)
ask by jaeyong translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…