beyonk-group / svelte-mapbox

MapBox Map and Autocomplete components for Svelte (or Vanilla JS)
MIT License
342 stars 62 forks source link

map height #92

Open Thebigbignooby opened 1 year ago

Thebigbignooby commented 1 year ago

Thanks for this library!

I understand the map can be displayed by setting a fixed height in pixels, however this is inconvenient... is there no way to have it take the full height of the parent container?

can this be fixed? what seems to be causing this behaviour?

woss commented 8 months ago

If your parent div has width:100% then your maps will respect that, but if the parent of the parent has the same it will be 0 since that is how things work. The best way is to use the vh measure. for example, you can set the parent container to be height: 70vh, and your maps will show.