Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 使用控制应用程序控制google earth_Windows_Google Earth_Google Earth Plugin_Pc - Fatal编程技术网

Windows 使用控制应用程序控制google earth

Windows 使用控制应用程序控制google earth,windows,google-earth,google-earth-plugin,pc,Windows,Google Earth,Google Earth Plugin,Pc,如果我要编写一个应用程序来控制另一个没有二进制文件的应用程序, 例如,一个应用程序本身会打开Google Earth并将相机放置在我的应用程序会告诉它的特定点,比如-24131,然后命令Google Earth将图像保存到特定文件夹中 如何解决这个问题? 我如何知道正在执行的函数并代表这样的控制程序启动它们? 此外,我还需要知道,下载的图像已经完成,所以我可以抓取图像 我看到google earth有一个API,但我不知道是否可以使用它来控制google earth(应用程序本身)您可以使用go

如果我要编写一个应用程序来控制另一个没有二进制文件的应用程序,
例如,一个应用程序本身会打开Google Earth并将相机放置在我的应用程序会告诉它的特定点,比如-24131,然后命令Google Earth将图像保存到特定文件夹中

如何解决这个问题? 我如何知道正在执行的函数并代表这样的控制程序启动它们? 此外,我还需要知道,下载的图像已经完成,所以我可以抓取图像


我看到google earth有一个API,但我不知道是否可以使用它来控制google earth(应用程序本身)

您可以使用google earth API(developers.google.com/earth/)来控制google earth globe实例

请参见此处的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.getOptions().setStatusBarVisibility(true);
    ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
    ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
    ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);

    var lookAt = ge.createLookAt('');
    lookAt.setLatitude(41.26);
    lookAt.setLongitude(-100.00);
    lookAt.setRange(800000.0);
    ge.getView().setAbstractView(lookAt);
}

function failureCB(errorCode) {
    alert(errorCode);
}

    google.setOnLoadCallback(init);
请参见此处的HTML代码:

<!DOCTYPE html>
<head>
    <script src="http://www.google.com/jsapi"></script>
</head>
    <style>
       body {
          margin:20px;
              height:100%;
          width:98%;
}
       #map3d {
          width:75%;
          float:right;
    }
</style>
<body>
  <div id="map3d"></div>
</body>
</html>

身体{
利润率:20px;
身高:100%;
宽度:98%;
}
#map3d{
宽度:75%;
浮动:对;
}
您可以使用wkhtml2pdf(code.google.com/p/wkhtmltopdf/)函数wkhtmltoimage或PhantomJs(github.com/ariya/PhantomJs/wiki/Screen Capture)获取图像版本

希望有帮助

干杯,
Mihai

是的,Google Earth API允许您这样做(即控制GE本身)。