Google 地球 API 与 Google 地球 COM API
我想在桌面应用程序中使用 Google 地球。
我的问题是,您认为 google 提供的这两个 API 中哪一个具有更多功能和/或最好的支持?
非常感谢
I want to use Google Earth in a desktop application.
My question is which one of these two APIs provided by google do you think has more functionality and/or best support?
Thank you very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Google 地球 API 是与 Google 地球浏览器插件配合使用的 Javascript API。
该 API 目前已更加成熟,提供了 Google Earth COM API 中当前未提供的功能,但仅限于 Google Earth 浏览器插件。
此处提供了一些简洁的示例。
如果您正在构建 Web 应用程序,这是您的选择。
Google Earth COM API 可用于从 Google Earth(独立应用程序)获取信息并向其发送命令。
这个 API 似乎比较年轻,或者至少可用的示例很少。
如果您正在构建桌面应用程序,这可能是自然的选择。 (我说可能是因为可以在桌面应用程序中嵌入某种浏览器对象,然后实现 Google 地球浏览器插件。)
因此,这更多的是一个Web 应用程序与非 Web 应用程序的问题,而不是功能。
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.
我不会重复 ak1123578 提供的好信息。然而,COM API 实际上比 JS API 更老,并且即将被淘汰。请参阅此处了解一些历史记录和公告:
Google Earth COM API 的日落
请注意,您可以通过在应用程序中嵌入 Web 浏览器组件来将 JS API 用于桌面应用程序。请参阅 这些 两个 线程以获得有关此的一些提示。
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
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.
Google Earth API 具有更多功能和支持。此外,COM api 现已弃用。
您可以查看我整理的这个控件库,它有助于在托管代码中使用 Google 地球插件。
http://code.google.com/p/winforms-geplugin-control- Library/
在访问 Google Earth API 中的对象时,它广泛使用了 C# 类型动态。本质上,这意味着您可以在托管代码中使用 Earth Api,就像使用 JavaScript 一样。
http://code.google.com/p/winforms-geplugin -control-library/wiki/ExampleForm
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
问题是,只有 COM API 似乎支持像 GE 独立应用程序那样的离线模式。对于 GE-API,您需要有可用的互联网连接,但这并不是适合所有情况的先决条件。
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.