Exporting the API.
This commit is contained in:
@@ -13,6 +13,7 @@ goog.require('goog.style');
|
|||||||
*
|
*
|
||||||
* @param {!Event} evt
|
* @param {!Event} evt
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
|
* @export
|
||||||
*/
|
*/
|
||||||
ol.event.isSingleTouch = function(evt) {
|
ol.event.isSingleTouch = function(evt) {
|
||||||
return !!(evt.touches && evt.touches.length == 1);
|
return !!(evt.touches && evt.touches.length == 1);
|
||||||
@@ -23,6 +24,7 @@ ol.event.isSingleTouch = function(evt) {
|
|||||||
*
|
*
|
||||||
* @param {!Event} evt
|
* @param {!Event} evt
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
|
* @export
|
||||||
*/
|
*/
|
||||||
ol.event.isMultiTouch = function(evt) {
|
ol.event.isMultiTouch = function(evt) {
|
||||||
return !!(evt.touches && evt.touches.length > 1);
|
return !!(evt.touches && evt.touches.length > 1);
|
||||||
@@ -45,6 +47,7 @@ ol.event.isMultiTouch = function(evt) {
|
|||||||
* false.
|
* false.
|
||||||
* @param {Array.<Object>=} opt_sequences Event sequences to register with this
|
* @param {Array.<Object>=} opt_sequences Event sequences to register with this
|
||||||
* events instance.
|
* events instance.
|
||||||
|
* @export
|
||||||
*/
|
*/
|
||||||
ol.event.Events = function(object, opt_element, opt_includeXY, opt_sequences) {
|
ol.event.Events = function(object, opt_element, opt_includeXY, opt_sequences) {
|
||||||
|
|
||||||
@@ -82,6 +85,7 @@ goog.inherits(ol.event.Events, goog.events.EventTarget);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Object} The object that this instance is bound to.
|
* @return {Object} The object that this instance is bound to.
|
||||||
|
* @export
|
||||||
*/
|
*/
|
||||||
ol.event.Events.prototype.getObject = function() {
|
ol.event.Events.prototype.getObject = function() {
|
||||||
return this.object_;
|
return this.object_;
|
||||||
@@ -89,6 +93,7 @@ ol.event.Events.prototype.getObject = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} includeXY
|
* @param {boolean} includeXY
|
||||||
|
* @export
|
||||||
*/
|
*/
|
||||||
ol.event.Events.prototype.setIncludeXY = function(includeXY) {
|
ol.event.Events.prototype.setIncludeXY = function(includeXY) {
|
||||||
this.includeXY_ = includeXY;
|
this.includeXY_ = includeXY;
|
||||||
@@ -97,6 +102,7 @@ ol.event.Events.prototype.setIncludeXY = function(includeXY) {
|
|||||||
/**
|
/**
|
||||||
* @return {EventTarget} The element that this instance currently
|
* @return {EventTarget} The element that this instance currently
|
||||||
* listens to browser events on.
|
* listens to browser events on.
|
||||||
|
* @export
|
||||||
*/
|
*/
|
||||||
ol.event.Events.prototype.getElement = function() {
|
ol.event.Events.prototype.getElement = function() {
|
||||||
return this.element_;
|
return this.element_;
|
||||||
@@ -109,6 +115,7 @@ ol.event.Events.prototype.getElement = function() {
|
|||||||
* @param {EventTarget=} opt_element A DOM element to attach
|
* @param {EventTarget=} opt_element A DOM element to attach
|
||||||
* browser events to. If called without this argument, all browser events
|
* browser events to. If called without this argument, all browser events
|
||||||
* will be detached from the element they are currently attached to.
|
* will be detached from the element they are currently attached to.
|
||||||
|
* @export
|
||||||
*/
|
*/
|
||||||
ol.event.Events.prototype.setElement = function(opt_element) {
|
ol.event.Events.prototype.setElement = function(opt_element) {
|
||||||
var t, types = goog.events.EventType;
|
var t, types = goog.events.EventType;
|
||||||
@@ -152,6 +159,7 @@ ol.event.Events.prototype.setElement = function(opt_element) {
|
|||||||
* property.
|
* property.
|
||||||
* @param {boolean=} opt_priority Register the listener as priority listener,
|
* @param {boolean=} opt_priority Register the listener as priority listener,
|
||||||
* so it gets executed before other listeners? Default is false.
|
* so it gets executed before other listeners? Default is false.
|
||||||
|
* @export
|
||||||
*/
|
*/
|
||||||
ol.event.Events.prototype.register = function(type, listener, opt_scope,
|
ol.event.Events.prototype.register = function(type, listener, opt_scope,
|
||||||
opt_priority) {
|
opt_priority) {
|
||||||
@@ -168,6 +176,7 @@ ol.event.Events.prototype.register = function(type, listener, opt_scope,
|
|||||||
* @param {Object=} opt_scope The object to bind the context to for the
|
* @param {Object=} opt_scope The object to bind the context to for the
|
||||||
* listener. If no scope is specified, default is the event's default
|
* listener. If no scope is specified, default is the event's default
|
||||||
* scope.
|
* scope.
|
||||||
|
* @export
|
||||||
*/
|
*/
|
||||||
ol.event.Events.prototype.unregister = function(type, listener, opt_scope) {
|
ol.event.Events.prototype.unregister = function(type, listener, opt_scope) {
|
||||||
goog.events.unlisten(
|
goog.events.unlisten(
|
||||||
@@ -183,6 +192,7 @@ ol.event.Events.prototype.unregister = function(type, listener, opt_scope) {
|
|||||||
*
|
*
|
||||||
* @return {boolean} The last listener return. If a listener returns false,
|
* @return {boolean} The last listener return. If a listener returns false,
|
||||||
* the chain of listeners will stop getting called.
|
* the chain of listeners will stop getting called.
|
||||||
|
* @export
|
||||||
*/
|
*/
|
||||||
ol.event.Events.prototype.triggerEvent = function(type, evt) {
|
ol.event.Events.prototype.triggerEvent = function(type, evt) {
|
||||||
var returnValue,
|
var returnValue,
|
||||||
@@ -264,6 +274,7 @@ ol.event.Events.prototype.handleBrowserEvent = function(evt) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroy this Events instance.
|
* Destroy this Events instance.
|
||||||
|
* @export
|
||||||
*/
|
*/
|
||||||
ol.event.Events.prototype.destroy = function() {
|
ol.event.Events.prototype.destroy = function() {
|
||||||
this.setElement();
|
this.setElement();
|
||||||
|
|||||||
Reference in New Issue
Block a user