2

Is it possible to programmatically capture the camera view from the Google Earth API?

Fraser
  • 15,275
  • 8
  • 53
  • 104

2 Answers2

0

You can use the copyAsLookAt() function to return the latitude and longitude where the camera is looking, etc. In example below, the returned values are passed to a new lookAt object:

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

Similarly, the view can be returned as a Camera value:

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

The rule of thumb is that if the view direction intersects the planet then a LookAt orientation is all that you need. If view direction is above the horizon then you need a Camera view.

Source: https://developers.google.com/earth/documentation/camera_control#current_view

CodeMonkey
  • 22,825
  • 4
  • 35
  • 75
  • Thanks, however I'm actually trying to capture a rasterized image of the camera contents. Pipe it to a folder maybe? I don't see anything in the documentation indicating this is possible with the stock functionality in the API. – Greg Angevine Nov 28 '12 at 05:50
  • For security reasons there is no access between javascript and the local file system. This is not a limitation on the Google Earth Plug-in, it is how the javascript sandbox works. http://en.wikipedia.org/wiki/JavaScript#Security – Fraser Dec 07 '12 at 19:16
0

Have you tried the "ScreenGrab" function?

bmp = geWebBrowser1.ScreenGrab();
CramerTV
  • 1,376
  • 1
  • 16
  • 29
  • This is a function for the GEWebBrowser contol in this library - http://code.google.com/p/winforms-geplugin-control-library/ it isn't really part of the Google Earth Api. – Fraser Dec 01 '12 at 17:34