Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different colors for paths using pathsData and pathColor #98

Open
alinamurvay opened this issue Nov 22, 2024 · 1 comment
Open

Different colors for paths using pathsData and pathColor #98

alinamurvay opened this issue Nov 22, 2024 · 1 comment

Comments

@alinamurvay
Copy link

alinamurvay commented Nov 22, 2024

I need to display 2 mobile earth terminals, and a moving satellite, and the paths between each terminals and the satellite, having the positions(lat, lng and alt(for satellite). I am trying to use pathsData, but I am unable to set different colors for the trajectories of each terminal/satellite and the paths between each terminal and the satellite. Is there any way to do this? Thank you!

Globe.pathsData([
terminal1Coords,
terminal2Coords,
satelliteCoords,
...terminal1ToSatellitePaths,
...terminal2ToSatellitePaths,
])
.pathColor(() => "red")
.pathResolution(4) // Solid lines
.pathDashLength(1)
.pathDashGap(0)
.pathTransitionDuration(satelliteCoords.length * 100);

@vasturiano
Copy link
Owner

@alinamurvay the pathColor method takes a path attribute that you can use to specify different colors for the various paths. So, something like

.pathColor(path => {
  return getPathColor(path); // the implementation of this function is up to you
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants