【问题标题】:Interactive google earth building交互式谷歌地球建筑
【发布时间】:2011-02-26 02:34:09
【问题描述】:

我想知道是否可以在 google earth 上创建建筑物;那 与我的网络服务器交换信息。所以我可以改变它让我们 说来自网络服务器的墙壁颜色,或服务每分钟发送新值。 谢谢

【问题讨论】:

    标签: google-earth


    【解决方案1】:

    是的,您可以创建一个 3d 对象并将其加载到 google earth 中,然后调整其属性。 一种方法是使用加载所需模型数据的 NetWorkLink 文件。您可以设置 NetWorkLink 以根据各种条件进行刷新,并且可以在 herf 属性中指定 CGI 脚本。一个伪示例将像这样工作。

    1) 在kml中定义的网络链接

    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://www.opengis.net/kml/2.2">
        <NetworkLink>
          <refreshVisibility>0</refreshVisibility>
          <flyToView>1</flyToView>
          <Link>
            <refreshInterval>2</refreshInterval>
            <viewRefreshMode>onStop</viewRefreshMode>
            <viewRefreshTime>1</viewRefreshTime>
            <href>http://yourserver.com/cgi-bin/loadbuilding.php</href>
          </Link>
        </NetworkLink>
    </kml>
    

    2)herf中指定的cgi脚本

      <?php
       // some logic to select a particular kmz file etc
       $fullPath = "path to your file";
    
       if ($fd = fopen ($fullPath, "r")) {
         header("Content-type: application/octet-stream");
         header("Content-Disposition: filename=building.kmz");
         header("Content-Type: application/vnd.google-earth.kml+xml\n");
         while(!feof($fd)) {
           $buffer = fread($fd, 2048);
           echo $buffer;
         }
         fclose ($fd);
         exit;
        }
      ?>
    

    【讨论】:

      猜你喜欢
      • 2010-10-28
      • 2013-04-25
      • 2017-04-25
      • 1970-01-01
      • 2011-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多