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

Retain Markers and Layers Whenever Leaving and Returning to Map Page #37

Merged

Conversation

ThorntonMatthewD
Copy link
Collaborator

@ThorntonMatthewD ThorntonMatthewD commented Oct 28, 2023

Fixes #25

Summary

Fixes an issue where whenever a user would go to the About page from the Map page and then back:

  • Any markers that were on the map were absent
  • Hovering over the layers control produced a shriveled icon- all layer options were gone
  • Users would need to refresh the page to see map data once again

Testing

  1. Enable some map layers
  2. Go to the About page
  3. Navigate back to the map page
    1. All of your active layers should be represented in:
      1. The markers the appear on the map
      2. The query parameters in the URL
      3. The layer control should have the checkboxes for these layers still checked (and the unchecked ones should appear also)
      4. The maintainer info in visible in that control as well
  4. Flip back and forth between the Map and About pages to ensure that performance does not degrade

Bonus:

  1. Take fuite for a spin to ensure there aren't any glaring memory leaks pertaining to step 4 above.
npx fuite http://localhost:4173/open-map-data-multi-layers-demo/\?lat\=34.84240835693139\&lng\=-82.4626922607422\&zoom\=12\&maps\=city-halls,breweries --iterations 10
  1. Compare your results with the live version at https://hackgvl.github.io/open-map-data-multi-layers-demo to make sure no new issues stem from these changes.

Thank you!

layers whenever leaving and then returning to the map page.
@ThorntonMatthewD ThorntonMatthewD self-assigned this Oct 28, 2023
@ThorntonMatthewD ThorntonMatthewD marked this pull request as ready for review October 28, 2023 05:51
describe("Attribution Control", () => {
it("Attribution control displays the proper message", () => {
loadMap("/");

cy.get(".leaflet-control-attribution").contains(
"Brought to you by HackGreenville Labs.",
"Brought to you by HackGreenville Labs",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed this period since it looked kind of odd in the little attribution bar. It's not directly related to these changes, so please let me know if you'd like for me to extract it.

Copy link
Member

@oliviasculley oliviasculley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for fixing this bug, this is amazing!

@oliviasculley oliviasculley merged commit 3631dce into hackgvl:develop Oct 29, 2023
1 check passed
@ThorntonMatthewD ThorntonMatthewD deleted the fix-retention-of-layers branch October 29, 2023 01:13
@ThorntonMatthewD
Copy link
Collaborator Author

Thank you so much for fixing this bug, this is amazing!

@oliviasculley Thank you for taking a look at this!

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.

Map doesn't navigate between tabs properly
2 participants