0

以下のように、Eclipseの動的WebプロジェクトにデプロイされたGoogle Earth API Developer's Guideからコードをコピーします。

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Sample</title>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
var ge;
google.load("earth","1");
function init(){
    google.earth.createInstance('map3d',initCB,failureCB);
}
function initCB(instance){
    ge=instance;
    ge.getWindow().setVisibility(true);
    ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW);
}
function failureCB(errorCode){
    alert("failure");
}
google.setOnloadCallback(init);
</script>

</head>
<body>
<div id="map3d" style="height:400px;width:600px;border:1px solid red"></div>
</body>

ウェブサイトには赤いフレームが表示されますが、地球は存在しません。私のコードの何が問題なのか、ありがとう!!

4

1 に答える 1

0

スペルミスがあります

google.setOnloadCallback(init);

次のようにする必要があります。

google.setOnLoadCallback(init);

于 2013-01-14T01:02:46.487 に答える