简体   繁体   English

当前地球视图的Google Earth Capture KML

[英]Google Earth Capture KML of current globe view

Does anyone know anyway to use something similar to polygon.getKml() except for the current LookAt or Camera containing all of the elements inside of the Earth View? 无论如何,除了当前的LookAt或包含Earth View内部所有元素的Camera之外,是否有人知道使用与polygon.getKml()类似的东西?

I have tried something along the lines of ge.getView().getKml() but getKml can only be applied to certain objects. 我已经尝试过类似ge.getView()。getKml()的方法,但是getKml只能应用于某些对象。

Also you can get each of the elements KML individually using a loop and: 您还可以使用循环和以下命令分别获取每个元素KML:

ge.getFeatures().getChildNodes().item(#).getKml();

however this will not give you the lookat or the camera. 但是,这不会给您带来外观或相机的感觉。

You can use either 您可以使用

var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);

or 要么

var camera = ge.getView().copyAsCamera(ge.ALTITUDE_RELATIVE_TO_GROUND);

see this page for documentation https://developers.google.com/earth/documentation/camera_control 请参阅此页面以获取文档https://developers.google.com/earth/documentation/camera_control

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM