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 1 year ago

offeringofpie commented 1 year 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 1 year 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 1 year 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.