mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-08-16 16:45:22 +00:00

committed by
GitHub

parent
4f52a36dc1
commit
633182a836
@ -138,11 +138,21 @@ describe('LatLngBounds', function () {
|
||||
});
|
||||
|
||||
describe('#contains', function () {
|
||||
it('returns true if contains latlng point', function () {
|
||||
it('returns true if contains latlng point as array', function () {
|
||||
expect(a.contains([16, 20])).to.eql(true);
|
||||
expect(L.latLngBounds(a).contains([5, 20])).to.eql(false);
|
||||
});
|
||||
|
||||
it('returns true if contains latlng point as {lat:, lng:} object', function () {
|
||||
expect(a.contains({lat: 16, lng: 20})).to.eql(true);
|
||||
expect(L.latLngBounds(a).contains({lat: 5, lng: 20})).to.eql(false);
|
||||
});
|
||||
|
||||
it('returns true if contains latlng point as L.LatLng instance', function () {
|
||||
expect(a.contains(L.latLng([16, 20]))).to.eql(true);
|
||||
expect(L.latLngBounds(a).contains(L.latLng([5, 20]))).to.eql(false);
|
||||
});
|
||||
|
||||
it('returns true if contains bounds', function () {
|
||||
expect(a.contains([[16, 20], [20, 40]])).to.eql(true);
|
||||
expect(a.contains([[16, 50], [8, 40]])).to.eql(false);
|
||||
|
Reference in New Issue
Block a user