Skip to content

Commit

Permalink
VectorMap: Fix Output Order of Latitude Bounds in Viewport Array (T12…
Browse files Browse the repository at this point in the history
…13567) (#27057)
  • Loading branch information
jdvictoria authored Apr 5, 2024
1 parent 707aefe commit f5eab99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/devextreme/js/viz/vector_map/projection.main.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ Projection.prototype = {
selectFarthestPoint(rt[0], rb[0], lt[0], lb[0]),
selectFarthestPoint(lb[1], rb[1], lt[1], rt[1])
]);
return [].concat(minMax.min, minMax.max);
return [].concat(minMax.min[0], minMax.max[1], minMax.max[0], minMax.min[1]);
},

// T254127
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ QUnit.test('setMaxZoom / not valid', function(assert) {
});

QUnit.test('getViewport', function(assert) {
assert.deepEqual(this.projection.getViewport(), [10, -15, 30, -5], 'viewport');
assert.deepEqual(this.projection.getViewport(), [10, -5, 30, -15], 'viewport');
});

QUnit.test('setViewport', function(assert) {
Expand Down Expand Up @@ -808,25 +808,25 @@ $.each([null, [-180, 90, 180, -20], [-50, 90, 180, -90], [-180, 20, 180, -90], [
QUnit.test('Longitude range is less than latitude range - at center', function(assert) {
this.projection1.setViewport([-40, 20, 40, -20]);

assert.arraysEqual(this.projection1.getViewport(), [-40, -37.098, 40, 37.098]);
assert.arraysEqual(this.projection1.getViewport(), [-40, 37.098, 40, -37.098]);
});

QUnit.test('Longitude range is greater than latitude range - at center', function(assert) {
this.projection1.setViewport([-10, 20, 10, -20]);

assert.arraysEqual(this.projection1.getViewport(), [-20.419, -20, 20.419, 20]);
assert.arraysEqual(this.projection1.getViewport(), [-20.419, 20, 20.419, -20]);
});

QUnit.test('Longitude range is less than latitude range - not at center', function(assert) {
this.projection1.setViewport([30, 40, 120, -30]);

assert.arraysEqual(this.projection1.getViewport(), [30, -36.2, 120, 45.4369]);
assert.arraysEqual(this.projection1.getViewport(), [30, 45.4369, 120, -36.2]);
});

QUnit.test('Longitude range is greater than latitude range - not at center', function(assert) {
this.projection1.setViewport([-100, 80, -40, 10]);

assert.arraysEqual(this.projection1.getViewport(), [-134.7677, 10, -5.2323, 80]);
assert.arraysEqual(this.projection1.getViewport(), [-134.7677, 80, -5.2323, 10]);
});

QUnit.module('Project', $.extend({}, environment, {
Expand Down

0 comments on commit f5eab99

Please sign in to comment.