Skip to content

Commit 6f031b2

Browse files
authored
Merge pull request #5485 from plotly/lat-lon-hover
Switch to latLon hoverlabel
2 parents 779afe6 + 122fd25 commit 6f031b2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/traces/scattergeo/hover.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function getExtraText(trace, pt, pointData, labels) {
8787
if(hasLocation) {
8888
text.push(pt.loc);
8989
} else if(hasLon && hasLat) {
90-
text.push('(' + format(pointData.lonLabel) + ', ' + format(pointData.latLabel) + ')');
90+
text.push('(' + format(pointData.latLabel) + ', ' + format(pointData.lonLabel) + ')');
9191
} else if(hasLon) {
9292
text.push(labels.lon + format(pointData.lonLabel));
9393
} else if(hasLat) {

test/jasmine/tests/scattergeo_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ describe('Test scattergeo hover', function() {
416416

417417
describe('should preserve lon/lat formatting hovetemplate equivalence', function() {
418418
var pos = [381, 221];
419-
var exp = ['(10.00012°, 10.00088°)\nA'];
419+
var exp = ['(10.00088°, 10.00012°)\nA'];
420420

421421
it('- base case (truncate z decimals)', function(done) {
422422
Plotly.restyle(gd, {
@@ -427,11 +427,11 @@ describe('Test scattergeo hover', function() {
427427
.then(done, done.fail);
428428
});
429429

430-
it('- hovertemplate case (same lon/lat truncation)', function(done) {
430+
it('- hovertemplate case (same lat/lon truncation)', function(done) {
431431
Plotly.restyle(gd, {
432432
lon: [[10.0001221321]],
433433
lat: [[10.00087683]],
434-
hovertemplate: '(%{lon}°, %{lat}°)<br>%{text}<extra></extra>'
434+
hovertemplate: '(%{lat}°, %{lon}°)<br>%{text}<extra></extra>'
435435
})
436436
.then(function() { check(pos, exp); })
437437
.then(done, done.fail);

0 commit comments

Comments
 (0)