Use getWest/South/East/North instead of getLeft/Bottom/Right/Top

This commit is contained in:
Yohan Boniface 2013-01-28 01:04:09 +01:00
parent 69b925b057
commit 4b5746ffbc
2 changed files with 17 additions and 17 deletions

View File

@ -21,30 +21,30 @@ describe('LatLngBounds', function() {
}); });
}); });
describe('#getLeft', function () { describe('#getWest', function () {
it('should return a proper bbox left value', function() { it('should return a proper bbox west value', function() {
expect(a.getLeft()).toEqual(12); expect(a.getWest()).toEqual(12);
}); });
}); });
describe('#getBottom', function () { describe('#getSouth', function () {
it('should return a proper bbox bottom value', function() { it('should return a proper bbox south value', function() {
expect(a.getBottom()).toEqual(14); expect(a.getSouth()).toEqual(14);
}); });
}); });
describe('#getRight', function () { describe('#getEast', function () {
it('should return a proper bbox right value', function() { it('should return a proper bbox east value', function() {
expect(a.getRight()).toEqual(40); expect(a.getEast()).toEqual(40);
}); });
}); });
describe('#getTop', function () { describe('#getNorth', function () {
it('should return a proper bbox top value', function() { it('should return a proper bbox north value', function() {
expect(a.getTop()).toEqual(30); expect(a.getNorth()).toEqual(30);
}); });
}); });

View File

@ -73,19 +73,19 @@ L.LatLngBounds.prototype = {
return new L.LatLng(this._southWest.lat, this._northEast.lng); return new L.LatLng(this._southWest.lat, this._northEast.lng);
}, },
getLeft: function () { getWest: function () {
return this._southWest.lng; return this._southWest.lng;
}, },
getBottom: function () { getSouth: function () {
return this._southWest.lat; return this._southWest.lat;
}, },
getRight: function () { getEast: function () {
return this._northEast.lng; return this._northEast.lng;
}, },
getTop: function () { getNorth: function () {
return this._northEast.lat; return this._northEast.lat;
}, },
@ -126,7 +126,7 @@ L.LatLngBounds.prototype = {
}, },
toBBoxString: function () { toBBoxString: function () {
return [this.getLeft(), this.getBottom(), this.getRight(), this.getTop()].join(','); return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(',');
}, },
equals: function (bounds) { // (LatLngBounds) equals: function (bounds) { // (LatLngBounds)