Skip to content

[BUG]: Plotly.Fx.hover error when used on Plotly map #7702

@platinops

Description

@platinops

Description

I want to have multiple traces get hover labels when I hover on one of the traces. This is similar to this example: https://plotly.com/javascript/hover-events/#coupled-hover-events

When I hover on one of the points, I get a JS error.

Steps to reproduce

  • Go to this codepen
  • Hover on one of the points
  • Console shows error similar to: Uncaught Error: Invalid LngLat object: (NaN, -1.1977990340856948)

Notes

The error occurs on this line:

var lonlatShifted = [Lib.modHalf(lonlat[0], 360) + lonShift, lonlat[1]];

The reason is that xval, and therefore winding and lonShift are undefined.

If I add lonShift = isNaN(lonShift) ? 0 : lonShift; just before this line, it works fine:

Image

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions