[英]OpenLayers: value of Event parameter in OpenLayers.Event.triggerEvent
我正在查看有關OpenLayers中觸發事件的文檔 。 它列出了具有type:String
參數和evt:Event
參數的triggerEvent
。 我了解type
參數是什么,但是Event
對象是什么對象? 我找不到明確的例子。
如果相關的話,我正在研究Google Maps v3和OpenLayers之間的接口,並且試圖提出一種方法,以便可以使用相同的API接口來調用:
google.maps.event.trigger(instance:Object, eventName:String, var_args:*)
openLayersObj.events.triggerEvent(type:String, evt:Event)
Doc是錯誤的。 應該是Event || object
Event || object
。 將作為args的對象傳遞給偵聽器回調。
查看源代碼: 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.