Source: bemap-model/bemap-boundingBox.js

/**
 * BeNomad BeMap JavaScript API - boundingBox
 */

/**
 * @classdesc
 * Base class for boudingBox.
 * @public
 * @constructor
 * @abstract
 * @param {double} minLat the minimal latitude of the bounding box.
 * @param {double} minLon the minimal longitude of the bounding box.
 * @param {double} maxLat the maximal latitude of the bounding box.
 * @param {double} maxLon the maximal longitude of the bounding box.
 */
bemap.BoundingBox = function(minLon, minLat, maxLon, maxLat) {
    /**
     * @type {double}
     * @protected
     */
    this.minLat = minLat;

    /**
     * @type {double}
     * @protected
     */
    this.maxLat = maxLat;

    /**
     * @type {double}
     * @protected
     */
    this.minLon = minLon;

    /**
     * @type {double}
     * @protected
     */
    this.maxLon = maxLon;
};

/**
 * Get the minimal longitude of the bounding box.
 * @return {double} the minimal longitude.
 */
bemap.BoundingBox.prototype.getMinLon = function() {
    return this.minLon;
};

/**
 * Get the maximal longitude of the bounding box.
 * @return {double} the maximal longitude.
 */
bemap.BoundingBox.prototype.getMaxLon = function() {
    return this.maxLon;
};

/**
 * Get the minimal latitude of the bounding box.
 * @return {double} the minimal latitude.
 */
bemap.BoundingBox.prototype.getMinLat = function() {
    return this.minLat;
};

/**
 * Get the maximal latitude of the bounding box.
 * @return {double} the maximal latitude.
 */
bemap.BoundingBox.prototype.getMaxLat = function() {
    return this.maxLat;
};

/**
 * Get the maximal coordinates of the bounding box.
 * @return {bemap.Coordinate} the maximal coordinates.
 */
bemap.BoundingBox.prototype.getMax = function() {
    return new bemap.Coordinate(this.maxLon, this.maxLat);
};

/**
 * Get the minimal coordinates of the bounding box.
 * @return {bemap.Coordinate} the minimal coordinates.
 */
bemap.BoundingBox.prototype.getMin = function() {
    return new bemap.Coordinate(this.minLon, this.minLat);
};

/**
 * Set the minimal longitude of the bounding box.
 * @param {double} minLon the new minimal longitude to set.
 * @return {bemap.BoundingBox} this;
 */
bemap.BoundingBox.prototype.setMinLon = function(minLon) {
    this.minLon = minLon;
    return this;
};

/**
 * Set the maximal longitude of the bounding box.
 * @param {double} maxLon the new maximal longitude to set.
 * @return {bemap.BoundingBox} this;
 */
bemap.BoundingBox.prototype.setMaxLon = function(maxLon) {
    this.maxLon = maxLon;
    return this;
};

/**
 * Set the minimal latitude of the bounding box.
 * @param {double} minLat the new minimal latitude to set.
 * @return {bemap.BoundingBox} this;
 */
bemap.BoundingBox.prototype.setMinLat = function(minLat) {
    this.minLat = minLat;
    return this;
};

/**
 * Set the maximal latitude of the bounding box.
 * @param {double} maxLat the new maximal latitude to set.
 * @return {bemap.BoundingBox} this;
 */
bemap.BoundingBox.prototype.setMaxLat = function(maxLat) {
    this.maxLat = maxLat;
    return this;
};

/**
 * Set the maximal coordinates of the bounding box.
 * @param {bemap.Coordinate} max the new maximal coordinates to set.
 * @return {bemap.BoundingBox} this;
 */
bemap.BoundingBox.prototype.setMax = function(max) {
    this.maxLat = max.lat;
    this.maxLon = max.lon;
    return this;
};

/**
 * Set the minimal coordinates of the bounding box.
 * @param {bemap.Coordinate} min the new minimal coordinates to set.
 * @return {bemap.BoundingBox} this;
 */
bemap.BoundingBox.prototype.setMin = function(min) {
    this.minLat = min.lat;
    this.minLon = min.lon;
    return this;
};