JSAN commenting

git-svn-id: http://svn.openlayers.org/trunk/openlayers@34 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-16 16:54:27 +00:00
parent b27500e511
commit a9b696d000

View File

@@ -22,6 +22,10 @@ OpenLayers.Events.prototype = {
"click", "dblclick"
],
/**
* @param {OpenLayers.Map} map
* @param {DOMElement} div
*/
initialize: function (map, div) {
this.listeners = {};
this.map = map;
@@ -36,16 +40,27 @@ OpenLayers.Events.prototype = {
}
},
/**
* @param {str} eventName
* @param {Object} obj
* @param {Function} func
*/
register: function (eventName, obj, func) {
var listeners = this.listeners[eventName];
listeners.push( func.bindAsEventListener(obj) );
},
/**
* @param {event} evt
*/
handleBrowserEvent: function (evt) {
evt.xy = this.getMousePosition(evt);
this.triggerMapEvent(evt.type, evt)
},
/**
* @param {event} evt
*/
getMousePosition: function (evt) {
var offsets = Position.page(this.div);
return new OpenLayers.Pixel(
@@ -53,6 +68,10 @@ OpenLayers.Events.prototype = {
evt.clientY - offsets[1]);
},
/**
* @param {str} type
* @param {event} evt
*/
triggerMapEvent: function (type, evt) {
evt.map = this.map;