如果我编写一个应用程序来控制另一个我没有二进制文件的应用程序,
例如,一个应用程序本身会打开谷歌地球并将相机放在特定点,我的应用程序会告诉它,比如说-24,131,然后命令谷歌地球将图像保存到特定的文件夹。
解决这个问题的方法是什么?我如何才能知道正在执行的函数,并代表这样的控制程序启动它们?此外,我还需要知道图像的下载已经完成,这样我才能抓取图像。
我看到有一个用于google earth的API,但我不知道是否可以使用它来控制google-earth (应用程序本身)
发布于 2013-09-09 14:10:27
您可以使用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>您可以使用wkhtml2pdf (code.google.com/p/wkhtmltopdf/)函数wkhtmltoimage或PhantomJs (github.com/ariya/phantomjs/wiki/Screen-Capture)获取镜像版本。
希望它能帮上忙!
干杯,米海
https://stackoverflow.com/questions/18559454
复制相似问题