Skip to content
New issue

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

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

Already on GitHub? # to your account

Bounding coordinates set to 0 don't display on dataset landing pages rendered from the index #2505

Closed
robyngit opened this issue Aug 28, 2024 · 0 comments · Fixed by #2512
Closed
Labels
bug dataset landing page Enhancements and bugs for the dataset landing pages good first issue A good place to start contributing to MetacatUI!
Milestone

Comments

@robyngit
Copy link
Member

The bounding coordinates are not displayed correctly on dataset landing pages that are rendered from the index when coordinates are set to 0. See for example, this dataset which has a southBound coord set to 0. The south coordinate is not shown and the Google Map preview is broken.

I assume the problem occurs because the code incorrectly treats 0 as a falsy value, leading to the coordinates not being shown. We are doing that here for example, and repeating the same check elsewhere.

Seems like we could use a function like:

const allCoordsExist = () => {
  const coordAttrs = ["northBoundCoord", "eastBoundCoord", "southBoundCoord", "westBoundCoord"];
  return coordAttrs.every(attr => model.get(attr) !== undefined);
}
@robyngit robyngit added bug dataset landing page Enhancements and bugs for the dataset landing pages good first issue A good place to start contributing to MetacatUI! labels Aug 28, 2024
@robyngit robyngit added this to the 2.31.0 milestone Aug 28, 2024
robyngit added a commit that referenced this issue Sep 9, 2024
@robyngit robyngit linked a pull request Sep 9, 2024 that will close this issue
@robyngit robyngit closed this as completed Sep 9, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug dataset landing page Enhancements and bugs for the dataset landing pages good first issue A good place to start contributing to MetacatUI!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant