added non-degree tests for all units
This commit is contained in:
@@ -286,6 +286,13 @@ describe('ol.control.ScaleLine', function() {
|
|||||||
ctrl.setUnits('imperial');
|
ctrl.setUnits('imperial');
|
||||||
expect(ctrl.element_.innerText).to.be('500 ft');
|
expect(ctrl.element_.innerText).to.be('500 ft');
|
||||||
|
|
||||||
|
ctrl.setUnits('nautical');
|
||||||
|
expect(ctrl.element_.innerText).to.be('0.05 nm');
|
||||||
|
|
||||||
|
ctrl.setUnits('imperial');
|
||||||
|
expect(ctrl.element_.innerText).to.be('500 ft');
|
||||||
|
|
||||||
|
|
||||||
map.setView(new View({
|
map.setView(new View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
zoom: 0,
|
zoom: 0,
|
||||||
@@ -306,6 +313,12 @@ describe('ol.control.ScaleLine', function() {
|
|||||||
|
|
||||||
ctrl.setUnits('imperial');
|
ctrl.setUnits('imperial');
|
||||||
expect(ctrl.element_.innerText).to.be('5 in');
|
expect(ctrl.element_.innerText).to.be('5 in');
|
||||||
|
|
||||||
|
ctrl.setUnits('nautical');
|
||||||
|
expect(ctrl.element_.innerText).to.be('0.00005 nm');
|
||||||
|
|
||||||
|
ctrl.setUnits('imperial');
|
||||||
|
expect(ctrl.element_.innerText).to.be('5 in');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Metric display works with Geographic (EPSG:4326) projection', function() {
|
it('Metric display works with Geographic (EPSG:4326) projection', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user