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

Fixing the default height problem #283

Closed
wants to merge 2 commits into from

Conversation

jtmiclat
Copy link
Contributor

@jtmiclat jtmiclat commented Dec 2, 2023

What I am changing

Fixing the default height problem

How I did it

Main factor here is setting the map's parent's div's display to flex.

The default display:block of the parent set's it values to based on children but since at initializing there is no contents/canvas/children for the parent this would be 0px when at 100%. While display:flex bypasses this.

Another common solution for web app is to set the height and width to 100vh and 100vw but this assumes that the map will cover the entire viewport/iframe/window which might not work for jupyter widgets.

How you can test it

Export a map using the following code:

import geopandas as gpd
from lonboard import viz
gdf = gpd.read_parquet(...) # any file would do
map = viz(gdf)
map.to_html("test.html")

Before:
Screenshot 2023-12-02 at 6 14 33 PM

After:
Screenshot 2023-12-02 at 6 13 37 PM

Let me know if you have other suggestions on how to test this!

Related Issues

Related to #247

@jtmiclat jtmiclat changed the title Set map's parent display to flex Fixing the default height problem Dec 2, 2023
@kylebarron
Copy link
Member

Hmm I went to your branch and tried this...
image

But it still doesn't appear to fill the height
image

@jtmiclat
Copy link
Contributor Author

jtmiclat commented Dec 4, 2023

Sorry, I think I screwed up and made a mistake with my assumption and tests. Closing for now until I can figure out how to address it!

@jtmiclat jtmiclat closed this Dec 4, 2023
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.

2 participants