简体   繁体   English

OpenLayers:OpenLayers.Event.triggerEvent中的Event参数的值

[英]OpenLayers: value of Event parameter in OpenLayers.Event.triggerEvent

I'm looking at the documentation for triggering events in OpenLayers . 我正在查看有关OpenLayers中触发事件的文档 It lists triggerEvent as taking in a type:String argument and a evt:Event argument. 它列出了具有type:String参数和evt:Event参数的triggerEvent I understand what the type parameter is, but what object is the Event object? 我了解type参数是什么,但是Event对象是什么对象? I can't find a clear example. 我找不到明确的例子。

If it is relevant, I am working on an interface between Google Maps v3 and OpenLayers , and I'm trying to come up with a way so that I can have a the same API interface to calls to: 如果相关的话,我正在研究Google Maps v3OpenLayers之间的接口,并且试图提出一种方法,以便可以使用相同的API接口来调用:

  • google.maps.event.trigger(instance:Object, eventName:String, var_args:*)
  • openLayersObj.events.triggerEvent(type:String, evt:Event)

Doc is wrong. Doc是错误的。 It should be Event || object 应该是Event || object Event || object . Event || object Object that will be args passed to the listeners callback. 将作为args的对象传递给侦听器回调。

Look at the source: https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Events.js#L820 Example of use: https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Map.js#L1042 查看源代码: https : //github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Events.js#L820使用示例: https : //github.com/openlayers/openlayers/blob/master/ LIB /的OpenLayers / Map.js#L1042

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM