首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Google earth插件无法工作

Google earth插件无法工作
EN

Stack Overflow用户
提问于 2013-01-07 10:25:45
回答 1查看 151关注 0票数 0

我复制了Google Earth API开发人员指南中的代码,部署在eclipse的动态Web项目中,如下所示。

代码语言:javascript
复制
<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>

网站显示红色框但地球不存在,我的代码有什么问题,谢谢!

EN

回答 1

Stack Overflow用户

发布于 2013-01-14 09:02:46

你有一个拼写错误在

Google.setOnloadCallback(初始化);

应该是:

Google.setOnLoadCallback(初始化);

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14189053

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档