google.earth命名空间参考--google earth开发学习
2009-12-03 10:41
495 查看
Public Functions | |
bool | isSupported () |
bool | isInstalled () |
void | createInstance (object domNode, function initCallback, function failureCallback,[optional] object options) |
void | addEventListener (object targetObject, string eventID, function listenerCallback,[optional] bool useCapture) |
void | removeEventListener (object targetObject, string eventID, function listenerCallback,[optional] bool useCapture) |
void | fetchKml (GEPlugin pluginInstance, string url, function completionCallback) |
void | executeBatch (GEPlugin pluginInstance, function batchFunction) |
Detailed Description
google.earth命名空间包括了使用Earth API接口的一些全局函数. 例如:通过
google.earth.createInstance方法,实例化Google Earth Browser Plug-in对象,并通过
google.earth.addEventListenerand
google.earth.removeEventListener方法来控制事件句柄.
Function Documentation
bool google.earth.isSupported | ( | ) |
bool google.earth.isInstalled | ( | ) |
Note: if the plug-in is not installed, the user will be presented with a 'download' link upon calls to google.earth.createInstance().
void google.earth.createInstance | ( | object | domNode, | |
function | initCallback, | |||
function | failureCallback, | |||
[optional] object | options | |||
) |
Note: The HTML DOM 必须在这个函数调用之前载入. 通常是在
<body>'s
load事件中调用这个函数, 或者使用
google.setOnLoadCallback.
Parameters:
domNode | Either the string ID of the HTML DOM element or the DOM element itself (usually a <div>) that will contain the plug-in instance or error message. | |
initCallback | A function that will be called with an instance of GEPlugin as the first parameter upon successful instantiation of the plugin. | |
failureCallback | A function that will be called upon failure to instantiate the plugin. The user will also be shown a graphical error description page in place of the plugin. | |
options | (optional) A JavaScript object literal (i.e, { option1: 'value1', option2: 'value2' }) containing extra initialization options. The following options are recognized: database The URL of an alternative Earth Enterprise database to connect to instead of the default database. Note: Certain changes may be required to your Google Earth Server configuration before Google Earth Plugin instances will be able to connect to it using this method. Google Earth Server versions 3.2 and higher are already pre-configured for connectivity with the plugin. Contact Google Earth Enterprise support for more details. Note: Keep in mind the Google Earth API Terms of Service while using this parameter. |
void google.earth.addEventListener | ( | object | targetObject, | |
string | eventID, | |||
function | listenerCallback, | |||
[optional] bool | useCapture | |||
) |
Parameters:
targetObject | The object on which to listen to the event. | |
eventID | The event string (i.e. 'click', 'mouseover', 'frameend', etc.) identifying the event to listen for. See the individual class reference pages for available events. | |
listenerCallback | A function that will be called with an instance of KmlEvent when the event occurs on the object. | |
useCapture | (optional) Whether or not this listener should initiate capture. For more details on event capture and bubbling, see the relevant W3C DOM documentation. |
void google.earth.removeEventListener | ( | object | targetObject, | |
string | eventID, | |||
function | listenerCallback, | |||
[optional] bool | useCapture | |||
) |
Note: You must pass in the exact same function object as was passed to addEventListener. If you are using an anonymous function callback, it will need to be refactored into its own variable.
Parameters:
targetObject | The object on which to stop listening to the event. | |
eventID | The event string (i.e. 'click', 'mouseover', 'frameend', etc.) identifying the event to stop listening for. | |
listenerCallback | The function, originally passed to google.earth.addEventListener(), that should no longer be called when the event occurs. | |
useCapture | (optional) Whether or not the originally added listener was set to initiate capture. |
void google.earth.fetchKml | ( | GEPlugin | pluginInstance, | |
string | url, | |||
function | completionCallback | |||
) |
Note: 这个函数不会在Earth中显示 the feature. See below for more information.
Parameters:
pluginInstance | 执行提取URL并解析的GEPlugin实例. | |
url | 提交KML or KMZ内容的URL. This URL should serve either the KML or KMZ content type. | |
completionCallback | 如果成功提取并解析了KML或者KMZ内容后,将调用此函数,并传递一个 KmlFeature-derived class 类的实例参数,作为该函数的第一个参数. 如果发生了错误,这个函数将会被传递一个null value. Note: 在这个函数里,你可以在Earth中显示载入的 KML,通过调用 ge.getFeatures().appendChild(object), assuming 'ge' is the GEPlugin instance variable in the callback function's scope and 'object' is the name of the first parameter to your callback function. |
void google.earth.executeBatch | ( | GEPlugin | pluginInstance, | |
function | batchFunction | |||
) |
Note:
This method is guaranteed to run synchronously; that is, executeBatch blocks and does not return until the batch function has completed. In fact there should be no difference between calling
executeBatch(fn)and
fn()besides execution performance.
Parameters:
pluginInstance | The instance of GEPlugin that batched API calls will be executed on. | |
batchFunction | The function containing the code to be executed. |
相关文章推荐
- 有关命名空间-----具体可参考MSDN帮助文档
- 命名空间(C# 参考)
- 复习PHP-语言参考-命名空间
- Google Earth KML 2.0 参考
- C# 弹框,提示错误:命名空间 'MessageBox' 中没有型别或命名空间名称‘Show’(您是否遗漏了组建参考?)
- C# 参考之命名空间关键字:namespace、using
- Google Earth KML 2.0 参考
- Spring Security-2.0.x参考文档的”使用命名空间简化配置“部分
- google closure 笔记-命名空间,依赖关系,calcdeps.py,closurebuilder,depswriter
- C#中找不到类型或命名空间名称"SqlConnection"以及连接别的数据库的命名空间
- CSS 命名规范参考及书写注意事项(转载)
- 关于头文件和命名空间
- 详细解读php的命名空间(二)
- PHP命名空间(Namespace)的使用详解副本
- Dom4j解析带有命名空间的XML文件
- 第十四节 命名空间 [14]
- spring 配置文件上面的命名空间和规范复习
- 二 : using声明、using指示用于嵌套命名空间时的作用域
- 关于带命名空间的gsoap工程编译
- 常用命名空间