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

Set leaflet NoWrap and bounds to prevent map & layers from repeating #2577

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

Conversation

corylown
Copy link
Contributor

Fixes #2550

Before:
Screenshot 2025-02-20 at 11 00 08 AM

After:
Screenshot 2025-02-20 at 10 59 38 AM

@dnoneill
Copy link
Contributor

@corylown The zoom is still doing odd things compared to the legacy viewer

@corylown
Copy link
Contributor Author

@dnoneill I suspect that has to do with the different size/shape of the map container in the new viewer. There's a way to increase the zoom beyond what gets calculated by leaflet via fitBounds, but I'm not sure we should do that until we migrate completely to the new geo viewer so we don't negatively impact the legacy geo viewer. I can spend a little more time on it now but I think it might be better to handle it in a separate commit.

@jcoyne
Copy link
Contributor

jcoyne commented Feb 20, 2025

Could this cause problems for any datasets that span 180 longitude? I know the Aleutian island chain crosses 180. Do we have any data like that to test on?

@dnoneill
Copy link
Contributor

@corylown I agree. I think just making sure we have the information recorded somewhere since it is not just Andrew who is a stakeholder and if a geo stakeholder has questions about this, I would like to have an answer recorded somewhere.

@jcoyne
Copy link
Contributor

jcoyne commented Feb 20, 2025

gk831nh0251 is a good test item for crossing 180.

@dnoneill
Copy link
Contributor

dnoneill commented Feb 20, 2025

@corylown I think there is something wrong with the calculations. I think the calculations for the area to zoom to need to be done after we know if the sidebar is open or not. This is the view of gk831nh0251 with the sidebar open vs closed. As you can see the data on the right is showing up only after you close the sidebar. Also I think this crossing 180 is an okay. I am also including a world repeat in this and it looks pretty similar.
Sidebar open on load
Screenshot 2025-02-20 at 5 38 03 PM

Closing the sidebar after the page has loaded
Screenshot 2025-02-20 at 5 38 09 PM

World repeat in current viewer
Screenshot 2025-02-20 at 5 40 32 PM

@corylown
Copy link
Contributor Author

@dnoneill I can't duplicate what you're seeing. When I load https://purl.stanford.edu/gk831nh0251 in the new geo viewer the map is loading at the correct size so the data on the far left and right is all visible:

Screenshot 2025-02-21 at 10 52 08 AM

@dnoneill
Copy link
Contributor

@corylown seems to be dependent on browser size.

@corylown corylown force-pushed the 2550-duplicate-maps branch from 10faed2 to 87a5a4d Compare February 24, 2025 21:05
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.

Odd behaivor new geo viewer
3 participants