【问题标题】:how to Change the Car model in Google earth 3D Driving Simulator?如何在 Google 地球 3D 驾驶模拟器中更改汽车模型?
【发布时间】:2013-01-05 21:00:01
【问题描述】:

我正在尝试对已经提供的 Google 地球驾驶模拟器进行修改:

http://earth-api-samples.googlecode.com/svn/trunk/demos/drive-simulator/index.html

我想用救护车文件替换提供的 3D 迷你卡车:

我上传的 KMZ 文件在我的 Dropbox 中:

这是公开的。(我从以下位置下载了它: http://sketchup.google.com/3dwarehouse/details?mid=fe0ea451b7322763f0ebaf08776cf07&prevstart=0)

我的代码是:

 window.google.earth.fetchKml(
      this.ge,
      DDSimulator.MODEL_URL,
      function(obj) {
          me.finishInitUI_(obj, opt_cb);
      });

它尝试调试脚本但没有结果,因为它没有抛出任何异常。模拟器根本不工作。

请让我知道造成此问题的可能原因。

谢谢

【问题讨论】:

    标签: javascript kml google-earth-plugin


    【解决方案1】:

    您需要编辑位于此处的 javascript 文件 simulator.jshttp://earth-api-samples.googlecode.com/svn/trunk/demos/drive-simulator/simulator.js

    所以将该文件保存到您的机器上,然后打开它进行编辑。

    设置MODEL_URL 的行是

    DDSimulator.MODEL_URL = 'http://earth-api-samples.googlecode.com/svn/trunk/' +
                            'demos/drive-simulator/smart.kmz';
    

    要使用其他模型,只需更改字段的值以指向您的文件。

    DDSimulator.MODEL_URL = 'http://www.yourserver.com/yourfile.kmz';
    

    显然你需要保存这个文件,例如my-simulator.js 并将您的实现指向它。

    <script type="text/javascript" src="my-simulator.js"></script>
    

    【讨论】:

      猜你喜欢
      • 2022-11-21
      • 1970-01-01
      • 1970-01-01
      • 2010-12-17
      • 1970-01-01
      • 1970-01-01
      • 2018-08-26
      • 2011-06-17
      • 1970-01-01
      相关资源
      最近更新 更多