Source: bemap-mapevent.js

/**
 * BeNomad BeMap JavaScript API - Event class
 */

/**
 * @classdesc
 * Base class for event.
 * @public
 * @constructor
 * @param {object} options Options object.
 * @param {object} options.native native object.
 * @param {object} options.map map object.
 * @param {object} options.bemapObject bemap object.
 * @param {int} options.x X coordinate in pixels.
 * @param {int} options.y Y coordinate in pixels.
 * @param {bemap.Coordinate} options.coordinate Coordinate.
 * @param {object} options.properties object can contains custom properties.
 */
bemap.MapEvent = function(options) {
  var opts = options || {};

  /**
   * Native map browser event.
   * @type {Object}
   * @protected
   */
  this.native = opts.native ? opts.native : null;

  /**
   * Map object that generated the event.
   * @type {bemap.Map}
   * @protected
   */
  this.map = opts.map ? opts.map : null;

  /**
   * BeMap SDK object like bemap.Marker, bemap.Polyline, etc.
   * @type {bemap.Object}
   * @protected
   */
  this.bemapObject = opts.bemapObject ? opts.bemapObject : null;

  /**
   * x coordinate in pixels.
   * @type {int}
   * @protected
   */
  this.x = opts.x ? opts.x : 0;

  /**
   * y coordinate in pixels.
   * @type {int}
   * @protected
   */
  this.y = opts.y ? opts.y : 0;

  /**
   * Coordinate of event (longitude and latitude).
   * @type {bemap.Coordinate}
   * @protected
   */
  this.coordinate = opts.coordinate ? opts.coordinate : new bemap.Coordinate();

  /**
   * x coordinate before event in pixels.
   * @type {int}
   * @protected
   */
  this.startX = opts.startX ? opts.startX : 0;

  /**
   * y coordinate before event in pixels.
   * @type {int}
   * @protected
   */
  this.startY = opts.startY ? opts.startY : 0;

  /**
   * Start coordinate before event (longitude and latitude).
   * @type {bemap.Coordinate}
   * @protected
   */
  this.startCoordinate = opts.startCoordinate ? opts.startCoordinate : new bemap.Coordinate();

  /**
   * @type {Object}
   * @protected
   */
  this.properties = opts.properties ? opts.properties : null;
};

/**
 * Return the bemap.Coordinate. See bemap.Coordinate.
 * @public
 * @return {bemap.Coordinate} Return the bemap.Coordinate. See bemap.Coordinate.
 */
bemap.MapEvent.prototype.getCoordinate = function() {
  return this.coordinate;
};