Sha256: 6ced1343bac07df521f81c024605fc0274db9db424026a621ef4df92d0582423

Contents?: true

Size: 739 Bytes

Versions: 1

Compression:

Stored size: 739 Bytes

Contents

describe("L.GeometryUtil", function () {
	var map, control, container;

	it("geodesicArea", function () {
		expect(L.GeometryUtil.geodesicArea([
			{ lat: 0,  lng: 0 },
			{ lat: 0,  lng: 10 },
			{ lat: 10, lng: 10 },
			{ lat: 10, lng: 0 },
			{ lat: 0,  lng: 0 }
		])).to.eql(1232921098571.292);
	});

	describe("readableDistance", function () {
		it("metric", function () {
			expect(L.GeometryUtil.readableDistance(1000, true)).to.eql('1000 m');
			expect(L.GeometryUtil.readableDistance(1500, true)).to.eql('1.50 km');
		});

		it("imperial", function () {
			expect(L.GeometryUtil.readableDistance(1609.3488537961)).to.eql('1760 yd');
			expect(L.GeometryUtil.readableDistance(1610.3488537961)).to.eql('1.00 miles');
		});
	});
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
leaflet-js-0.8.dev2 lib/leaflet.draw/spec/suites/GeometryUtilSpec.js