I'm looking at the documentation for triggering events in OpenLayers . It lists triggerEvent
as taking in a type:String
argument and a evt:Event
argument. I understand what the type
parameter is, but what object is the Event
object? 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.event.trigger(instance:Object, eventName:String, var_args:*)
openLayersObj.events.triggerEvent(type:String, evt:Event)
Doc is wrong. It should be Event || object
Event || object
. Object that will be args passed to the listeners callback.
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.