Skip to content

Added Map popup logic to hide null title and file icon #98

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SummittDweller
Copy link

Pull request

Proposed changes

This simple code change hides both the "null" title and default icon that previously appeared in Map page pop-ups for items that had no title field value.

In my personal project, visible at https://thankful-sea-06fcb2e0f.4.azurestaticapps.net/map.html, each map point corresponds to a stop along the route. End-of-day stops have a title, generally the date of that overnight stop, while intermediate stops are treated as child items of the end-of-day "compound" parent, and they have no title in the CSV data.

Without this change all intermediate map points displayed pop-ups like the one I captured here:
Screenshot 2025-02-19 at 8 27 50 AM.

I searched the documentation for specifics about Map page pop-up behavior but found very little to work with, so I did not introduce any changes in the documentation. However, I'd like to suggest adding a small section to /docs/maps.md describing this behavior as well as other features of the Map pop-up elements.

Types of changes

  • New feature (non-breaking change which adds functionality).
  • Enhancement (non-breaking change which enhances functionality)
  • Bug Fix (non-breaking change which fixes an issue).
  • Breaking change (fix or feature that would cause existing functionality to change).

Checklist

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@evanwill
Copy link
Contributor

the option added for records without titles, popupTemplate = '<h2 class="h4"><a class="text-dark" href="' + itemHref + '">' + '</a></h2><p>'; will create an empty header with an empty links with no text, which is an issue for accessibility.
In your use case example of your project, a better approach might be to move the "location" value you have in the child objects into the "title" (or make the title "Location: X")--this would achieve the same look without causing accessibility issues, using the current CB logic without changes.

@Digital-Grinnell
Copy link

Digital-Grinnell commented Feb 20, 2025 via email

@SummittDweller
Copy link
Author

SummittDweller commented Feb 20, 2025

Ouch, sorry for replying via email. I didn't realize it would include so much gunk! I hope/suspect that's mostly due to our ProofPoint obfuscation protection, but I'll try not to do that again!

I also did not realize that pushing another change to my fork would automatically append that commit to this PR. That was not my intent, yet, but I hope it does no harm.

So, the latest change just removes the entire h2... tag from the popup if there is no title specified. In conjunction with that I also modified my config-map.csv to remove the creator field and add the description field. I think that result is exactly what I was hoping for and it is live in a few minutes at https://thankful-sea-06fcb2e0f.4.azurestaticapps.net/map.html.

Merging recent CB changes into my fork.
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

Successfully merging this pull request may close these issues.

3 participants