Google Earth API vs Google Earth COM API
I want to use Google Earth in a desktop application.
My question is which one of these two APIs provided by google d开发者_运维百科o you think has more functionality and/or best support?
Thank you very much
Google Earth API is a Javascript API for use with the Google Earth browser plug-in.
This API is currently much more developed and offers features not currently found in the Google Earth COM API, but it is limited to the Google Earth browser plug-in.
There are some neat examples here.
If you are building a web application, this is your choice.
Google Earth COM API can be used to get information from and send commands to Google Earth (the standalone application).
This API appears to be younger or at least there are very few examples available.
If you are building a desktop application, this is probably the natural choice. (I say probably because it is possible to embed a browser object of some variety in a desktop application and then implement the Google Earth browser plug-in.)
So it's more a matter of Web Application vs Not, rather than functionality.
I won't reiterate the good information ak1123578 gave. However the COM API is actually older than the JS API, and is on its way out. See here for some history and announcement: Sunset for the Google Earth COM API
Today we’re announcing that the Google Earth 5.2 client will be the last version that supports the COM API. Earth 5.2 and older clients will continue to support the COM API while these versions are supported. Future releases will no longer have COM API bindings. We believe that the JavaScript API provides the best mechanism for reaching the most developers.
Note that you may be able to use the JS API for a desktop app by embedding a web browser component in your app. See these two threads for some hints about that.
The Google Earth API has more features and support. Also, the COM api is now depreciated.
You could take a look at this control library I have put together that helps working with the Google Earth Plugin in managed code.
http://code.google.com/p/winforms-geplugin-control-library/
It makes extensive use of the C# type dynamic when accessing objects in the Google Earth API. Essentially this means that you can use the Earth Api in managed code just as if you where using JavaScript.
http://code.google.com/p/winforms-geplugin-control-library/wiki/ExampleForm
Problem is that only the COM API seems to support the offline-mode like GE Standalone App does. For the GE-API, you need to have a working internet-connection, which is not a suitable prerequisite for all situations.
精彩评论