Closed wx007 closed 8 months ago
Figured it out. Apparently, you need to explicitly set the parent container width and height. The parent container's implicit size is not picked up by maplibre for some reason. I set sizes to 100% and now the map elements correctly stretch to fill their parent divs.
Anyone know how to programmatically call the maplibre resize() method from svelte-maplibre? I'm having an issue where maps don't stretch to fill their parent container when they are loaded. Using vanilla Javascript I get get the map to expand by issuing map.resize() immediately after load. Through various tests and googling it appears that the canvas is not picking up the parent container's size when it loads. Regardless, need to resize the map as the window is resized so it would be nice to have access to this method through the svelte component. Any ideas?
Thanks!