lemiffe / ai-streetview

This Street View Does Not Exist
1 stars 0 forks source link

Bugfix: When resizing the window the map moves down a few centimetres (pan) -- magically fixed somehow #3

Open offeringofpie opened 2 years ago

offeringofpie commented 2 years ago

@lemiffe will this help? https://leafletjs.com/reference.html#resizeevent or https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver or something like:

map.on('map-container-resize', () => {
   map.invalidateSize();
});
lemiffe commented 2 years ago

yeah that was already there in the default implementation of Leaflet for Svelte, but it doesn't work... ever since I made the container larger for some reason it jumps down when resizing - weird one

offeringofpie commented 2 years ago

It's also a fringe issue, no?

The only situation I see that we have to seriously account for window resizing is when rotating a phone screen.