mariusandra / pigeon-maps

ReactJS Maps without external dependencies
https://pigeon-maps.js.org/
MIT License
3.44k stars 142 forks source link

Use a ResizeObserver to update the size even when the window doesn't resize #125

Closed mischnic closed 3 years ago

mischnic commented 3 years ago

There are cases where the map size changes but the window size stays the same (so the resize event doesn't trigger), causing these grey areas:

https://user-images.githubusercontent.com/4586894/110855451-a7742e80-82b6-11eb-90d0-05cc5895fff1.mp4

A ResizeObserver can be used to still update the measured size:

https://user-images.githubusercontent.com/4586894/110855460-a93df200-82b6-11eb-9d80-559c75454573.mp4

(I wasn't able to achieve this in "userland" via the exposed props)