Monday, January 21, 2008

Embed Google Earth Into Your Application

This method for customizing the Google Earth Interface, embedding the Google Earth render window (the actual map window) into your own applications, was apparently pioneered Luca Rocchi and his Google Earth Airlines application. Luca figured out that you could grab the GE map window using its Windows handle to place it into your own application. He has used this to plop GE into web applications, but the ActiveX control that he provides for free can also be used in any COM compliant language (such as VB.Net or C#). I have used this plugin (and a similar one of my own design) to access external applications from Google Earth.

This method lets you completely encapsulate Google Earth with your own tools. However, it also hides the Google Earth tools. To get around this, you can assign the entire Google Earth application to be a child to your own custom application. Interestingly, not too long after Luca released his 'Google Earth Airlines' plugin, Google provided a method in their API to directly access the Windows Handle of both the render window (actual map) and the application window (the full application).

11 comments:

  1. Hi
    I want to Embed Google Earth Into my web Application.
    Do you know where I can find a tutorial to show me how to do this.
    Thanks,
    Jason
    http://www.prop2go.com

    ReplyDelete
  2. There is good information on how to build your own Google Earth control at Google Groups for KML:

    http://groups.google.com/group/kml-support-com-api/browse_thread/thread/647e42ecdf18419f/e4d0a53459fca522?hl=en&lnk=gst&q=render+window+embed#e4d0a53459fca522

    Also, you can see delphi code to do the same thing at googleearthairlines. .

    http://www.googleearthairlines.com/

    ReplyDelete
  3. Anonymous8:05 AM

    "(and a similar one of my own design)" in which language you made it?

    ReplyDelete
  4. So how exactly do you use GooglEarthAirlines to embed the render window into your own applications?

    For me:
    I had a picturebox and tried to put the render window in there, but failed to do so as I cannot understand how GetRenderHwnd works (why it returns an integer) and how to manipulate it.

    ReplyDelete
  5. You just need to reference the GoogleEarthAirlines ActiveX control in your Visual Studio project. That adds the control to your tools so that you can drag and drop it onto your form.

    ReplyDelete
  6. If you would like to know how to embed google earth into a c# application, here's how you can do it. The biggest issue was figuring out what messages to send to the render window to get it to resize accordingly.

    http://libjoe.blogspot.com/

    Enjoy,
    Joseph Armbruster

    ReplyDelete
  7. Anonymous11:37 AM

    I'm attempting to embed Google Earth into my Matlab application by placing a GE Activex object on my Matlab GUI. Is there any sample code that would show how to accomplish this. Thank you.
    Renee

    ReplyDelete
  8. Anonymous3:12 AM

    hi is there any option to embed a custom toolbar into the google earth application. ie i want to create an application in .Net which when installed will embed a toolbar in the google earth application(eg: when google toobar is installed it is embedded into the browser automaticaly)

    ReplyDelete
  9. how can i find the activeX control ? And where i can find it

    ReplyDelete
  10. http://www.google.co.ke/search?hl=en&source=hp&q=google+api&aq=f&aqi=g10&aql=&oq=&gs_rfai=

    all those who want to know how to embed google can use that link to understand more on google API.

    ReplyDelete
  11. I am doing a C# Project wherein I want Google Maps; Satellite & RoadMap both the views to be on the screen. When I provide a zoom option, both the maps should render it and zoom.
    Can anyone help.

    mobilegameroids.wordpress.com

    ReplyDelete