diff --git a/src/traces/scattergeo/hover.js b/src/traces/scattergeo/hover.js index f9542579895..b9d54ae6f7d 100644 --- a/src/traces/scattergeo/hover.js +++ b/src/traces/scattergeo/hover.js @@ -87,7 +87,7 @@ function getExtraText(trace, pt, pointData, labels) { if(hasLocation) { text.push(pt.loc); } else if(hasLon && hasLat) { - text.push('(' + format(pointData.lonLabel) + ', ' + format(pointData.latLabel) + ')'); + text.push('(' + format(pointData.latLabel) + ', ' + format(pointData.lonLabel) + ')'); } else if(hasLon) { text.push(labels.lon + format(pointData.lonLabel)); } else if(hasLat) { diff --git a/test/jasmine/tests/scattergeo_test.js b/test/jasmine/tests/scattergeo_test.js index 4a57113c9ab..389e4467b26 100644 --- a/test/jasmine/tests/scattergeo_test.js +++ b/test/jasmine/tests/scattergeo_test.js @@ -416,7 +416,7 @@ describe('Test scattergeo hover', function() { describe('should preserve lon/lat formatting hovetemplate equivalence', function() { var pos = [381, 221]; - var exp = ['(10.00012°, 10.00088°)\nA']; + var exp = ['(10.00088°, 10.00012°)\nA']; it('- base case (truncate z decimals)', function(done) { Plotly.restyle(gd, { @@ -427,11 +427,11 @@ describe('Test scattergeo hover', function() { .then(done, done.fail); }); - it('- hovertemplate case (same lon/lat truncation)', function(done) { + it('- hovertemplate case (same lat/lon truncation)', function(done) { Plotly.restyle(gd, { lon: [[10.0001221321]], lat: [[10.00087683]], - hovertemplate: '(%{lon}°, %{lat}°)
%{text}' + hovertemplate: '(%{lat}°, %{lon}°)
%{text}' }) .then(function() { check(pos, exp); }) .then(done, done.fail);